Index: branches/RC/core/units/categories/categories_event_handler.php =================================================================== diff -u -N -r11661 -r11682 --- branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 11661) +++ branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 11682) @@ -452,21 +452,22 @@ $object =& $this->Application->recallObject($this->Prefix . '.-new', null, Array('skip_autoload' => true)); /* @var $object kDBItem */ - $this->_prepareAutoPage($object, $template); // create virtual page + $created = $this->_prepareAutoPage($object, $template, null, SMS_MODE_AUTO, false); // create virtual (not system!) page + if ($created) { + if ($this->Application->ConfigValue('QuickCategoryPermissionRebuild') || !$this->Application->IsAdmin()) { + $updater =& $this->Application->recallObject('kPermCacheUpdater'); + /* @var $updater kPermCacheUpdater */ - if ($this->Application->ConfigValue('QuickCategoryPermissionRebuild') || !$this->Application->IsAdmin()) { - $updater =& $this->Application->recallObject('kPermCacheUpdater'); - /* @var $updater kPermCacheUpdater */ + $updater->OneStepRun(); + } - $updater->OneStepRun(); - } + $event->CallSubEvent('OnResetMenuCache'); - $event->CallSubEvent('OnResetMenuCache'); + $this->Application->RemoveVar('PermCache_UpdateRequired'); - $this->Application->RemoveVar('PermCache_UpdateRequired'); - - $page_id = $object->GetID(); - $this->Application->SetVar('m_cat_id', $page_id); + $page_id = $object->GetID(); + $this->Application->SetVar('m_cat_id', $page_id); + } } if ($page_id) { @@ -1344,6 +1345,11 @@ $system = $system_mode == SMS_MODE_FORCE ? 1 : 0; } + if ($system && $template_info === false) { + // do not autocreate system pages, when browsing through site + return false; + } + if (!isset($theme_id)) { $theme_id = $this->_getCurrentThemeId(); }