Index: branches/RC/core/units/categories/cache_updater.php =================================================================== diff -u -N -r11501 -r11504 --- branches/RC/core/units/categories/cache_updater.php (.../cache_updater.php) (revision 11501) +++ branches/RC/core/units/categories/cache_updater.php (.../cache_updater.php) (revision 11504) @@ -331,7 +331,7 @@ $data['titles'] = Array(); $data['parent_path'] = Array(); $data['named_path'] = Array(); - $data['category_template'] = ''; + $data['template'] = ''; // design $data['item_template'] = ''; $data['children_count'] = 0; // $data['system'] = 0; @@ -372,7 +372,7 @@ $next_data['titles'] = $data['titles']; $next_data['parent_path'] = $data['parent_path']; $next_data['named_path'] = $data['named_path']; - $next_data['category_template'] = $data['category_template']; + $next_data['template'] = $data['template']; $next_data['item_template'] = $data['item_template']; $next_data['current_id'] = $data['children'][ $data['current_child'] ]; //next iteration should process child $next_data['perms'] = $data['perms']; //we should copy our permissions to child - inheritance @@ -405,13 +405,14 @@ function UpdateCachedPath(&$data) { $fields_hash = Array ( - 'ParentPath' => '|'.implode('|', $data['parent_path']).'|', - 'NamedParentPath' => /*$data['system'] ? $data['file_name'] :*/ implode('/', $data['named_path'] ), - 'CachedCategoryTemplate' => $data['category_template'], - 'CachedDescendantCatsQty' => $data['children_count'], - 'TreeLeft' => $data['left'], - 'TreeRight' => $data['right'], - ); + 'ParentPath' => '|'.implode('|', $data['parent_path']).'|', + // allow old fashion system templates to work + 'NamedParentPath' => strpos($data['file_name'], '/') !== false ? $data['file_name'] : implode('/', $data['named_path'] ), + 'CachedTemplate' => $data['template'], + 'CachedDescendantCatsQty' => $data['children_count'], + 'TreeLeft' => $data['left'], + 'TreeRight' => $data['right'], + ); $i = 1; while ($i <= $this->languageCount) { @@ -447,20 +448,20 @@ $data['file_name'] = $record['Filename']; // it is one of the modules root category - $root_prefix = isset($this->root_prefixes[$category_id]) ? $this->root_prefixes[$category_id] : false; + /*$root_prefix = isset($this->root_prefixes[$category_id]) ? $this->root_prefixes[$category_id] : false; if ($root_prefix) { $fields_hash = Array(); - if (!$record['CategoryTemplate']) { - $record['CategoryTemplate'] = $this->Application->ConfigValue($root_prefix.'_CategoryTemplate'); - $fields_hash['CategoryTemplate'] = $record['CategoryTemplate']; + if (!$record['Template']) { + $record['Template'] = $this->Application->ConfigValue($root_prefix.'_CategoryTemplate'); + $fields_hash['Template'] = $record['Template']; } $this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Category', 'CategoryId = '.$category_id); - } + }*/ // if explicitly set, then use it; use parent template otherwise - if ($record['CategoryTemplate']) { - $data['category_template'] = $record['CategoryTemplate']; + if ($record['Template']) { + $data['template'] = $record['Template']; } }