Index: trunk/core/units/categories/categories_event_handler.php =================================================================== diff -u -N -r8104 -r8428 --- trunk/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 8104) +++ trunk/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 8428) @@ -89,10 +89,10 @@ { $category_id = $this->Application->GetVar($event->getPrefixSpecial().'_id'); $this->Application->StoreVar('IsRootCategory_'.$this->Application->GetVar('m_wid'), $category_id === '0'); - + parent::OnEdit($event); } - + /** * Apply system filter to categories list * @@ -118,8 +118,7 @@ if ($parent_cat_id == 'Root') { $module_name = $event->getEventParam('module') ? $event->getEventParam('module') : 'In-Commerce'; - $module =& $this->Application->recallObject('mod.'.$module_name); - $parent_cat_id = $module->GetDBField('RootCat'); + $parent_cat_id = $this->Application->findModule('Name', $module_name, 'RootCat'); } } @@ -403,10 +402,10 @@ function OnPreCreate(&$event) { $this->Application->RemoveVar('IsRootCategory_'.$this->Application->GetVar('m_wid')); - + parent::OnPreCreate($event); } - + /** * Checks cache update mark and redirect to cache if needed * @@ -426,7 +425,7 @@ $wid = $this->Application->GetVar('m_wid'); $stack_name = rtrim('opener_stack_'.$wid, '_'); $this->Application->RemoveVar('IsRootCategory_'.$wid); - + $opener_stack = unserialize($this->Application->RecallVar($stack_name)); $opener_stack[0] = str_replace('catalog', 'categories/cache_updater', $opener_stack[0]); $this->Application->StoreVar($stack_name, serialize($opener_stack)); @@ -444,15 +443,15 @@ { $object =& $event->getObject( Array('skip_autoload' => true) ); /* @var $object CategoriesItem */ - + if ($object->IsRoot()) { // don't create root category while saving permissions return ; } - + parent::OnPreSaveCreated($event); } - + /** * Deletes all selected items. * Automatically recurse into sub-items using temp handler, and deletes sub-items