Index: branches/RC/core/units/categories/categories_event_handler.php =================================================================== diff -u -N -r11501 -r11504 --- branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 11501) +++ branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 11504) @@ -441,7 +441,7 @@ WHERE (NamedParentPath = ' . $this->Conn->qstr($template) . ') OR (NamedParentPath = ' . $this->Conn->qstr('Content/' . $template) . ') OR - (IsSystem = 1 AND Template = ' . $this->Conn->qstr($template) . ')'; + (IsSystem = 1 AND CachedTemplate = ' . $this->Conn->qstr($template) . ')'; $page_id = $this->Conn->GetOne($sql); } else { @@ -561,7 +561,7 @@ $live_object =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('live_table' => true, 'skip_autoload' => true)); $live_object->Load($id); - $cached_fields = Array('Name', 'Filename', 'CategoryTemplate', 'ParentId', 'Priority'); + $cached_fields = Array('Name', 'Filename', 'Template', 'ParentId', 'Priority'); foreach ($cached_fields as $cached_field) { if ($live_object->GetDBField($cached_field) != $temp_object->GetDBField($cached_field)) { @@ -599,7 +599,7 @@ $object =& $event->getObject(); // 2. preset template - $object->SetDBField('Template', $this->_getDefaultDesign()); +// $object->SetDBField('Template', $this->_getDefaultDesign()); $priority_helper =& $this->Application->recallObject('PriorityHelper'); /* @var $priority_helper kPriorityHelper */ @@ -1238,7 +1238,7 @@ $page =& $this->Application->recallObject($this->Prefix . '.-virtual', null, Array ('page' => $t)); if($page->isLoaded()) { - $real_t = $page->GetDBField('Template'); + $real_t = $page->GetDBField('CachedTemplate'); $this->Application->SetVar('m_cat_id', $page->GetDBField('CategoryId') ); if ($page->GetDBField('FormId')) { $this->Application->SetVar('form_id', $page->GetDBField('FormId')); @@ -1366,7 +1366,7 @@ $page_description = ''; if ($system) { - $design_template = strtolower($template); + $design_template = strtolower($template); // leading "/" not added ! $template_info = $this->_getTemplateInfo($design_template, $theme_id); if ($template_info) { if (array_key_exists('name', $template_info) && $template_info['name']) { @@ -1384,7 +1384,7 @@ } } else { - $design_template = $this->_getDefaultDesign(); + $design_template = $this->_getDefaultDesign(); // leading "/" added ! } // put all templates to then end of list (in their category) @@ -1411,7 +1411,8 @@ $object->SetDBField('IsMenu', 0); $object->SetDBField('ThemeId', $system ? $theme_id : 0); $object->SetDBField('Priority', $min_priority - 1); - $object->SetDBField('Template', $design_template); // bug: possible case, when leading "/" is missing + $object->SetDBField('Template', $design_template); + $object->SetDBField('CachedTemplate', $design_template); $primary_language = $this->Application->GetDefaultLanguageId(); $current_language = $this->Application->GetVar('m_lang');