Index: branches/5.2.x/core/units/categories/categories_event_handler.php =================================================================== diff -u -N -r14474 -r14560 --- branches/5.2.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 14474) +++ branches/5.2.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 14560) @@ -1,6 +1,6 @@ getObject( Array('skip_autoload' => true) ); + /* @var $temp_object kDBItem */ + $temp_object->Load($id); if ($id == 0) { @@ -925,6 +927,7 @@ $change_events = Array ('OnPreSave', 'OnPreSaveCreated', 'OnUpdate', 'OnSave'); if ($type == 'after' && in_array($event->Name, $change_events)) { $object =& $event->getObject(); + /* @var $object kDBItem */ $tmp = $this->Application->RecallVar('priority_changes'.$this->Application->GetVar('m_wid')); $changes = $tmp ? unserialize($tmp) : array(); @@ -998,8 +1001,13 @@ $to_delete = array(); if ($recycle_bin = $this->Application->ConfigValue('RecycleBinFolder')) { $rb =& $this->Application->recallObject('c.recycle', null, Array ('skip_autoload' => true)); + /* @var $rb CategoriesItem */ + $rb->Load($recycle_bin); + $cat =& $event->getObject(Array('skip_autoload' => true)); + /* @var $cat CategoriesItem */ + foreach ($ids as $id) { $cat->Load($id); if (preg_match('/^'.preg_quote($rb->GetDBField('ParentPath'),'/').'/', $cat->GetDBField('ParentPath'))) { @@ -1325,6 +1333,7 @@ } $object =& $event->getObject(); + /* @var $object kDBItem */ $cache_updater =& $this->Application->makeClass('kPermCacheUpdater', Array (null, $object->GetDBField('ParentPath'))); /* @var $cache_updater kPermCacheUpdater */ @@ -1402,6 +1411,8 @@ } $object =& $event->getObject( Array('skip_autoload' => true) ); + /* @var $object CategoriesItem */ + $ids = $this->StoreSelectedIDs($event); if ($ids) { @@ -1652,6 +1663,7 @@ function OnBeforeItemDelete(&$event) { $object =& $event->getObject(); + /* @var $object kDBItem */ if ( $object->GetDBField('Protected') && !$this->Application->isDebugMode() ) { $event->status = kEvent::erFAIL; @@ -1851,14 +1863,14 @@ { // reset cms menu cache (all variables are automatically rebuild, when missing) if ($this->Application->isCachingType(CACHING_TYPE_MEMORY)) { - $this->Application->deleteCache('master:cms_menu'); - $this->Application->deleteCache('master:StructureTree'); - $this->Application->deleteCache('master:template_mapping'); + $this->Application->rebuildCache('master:cms_menu', kCache::REBUILD_LATER, CacheSettings::$cmsMenuRebuildTime); + $this->Application->rebuildCache('master:StructureTree', kCache::REBUILD_LATER, CacheSettings::$structureTreeRebuildTime); + $this->Application->rebuildCache('master:template_mapping', kCache::REBUILD_LATER, CacheSettings::$templateMappingRebuildTime); } else { - $this->Application->deleteDBCache('cms_menu'); - $this->Application->deleteDBCache('StructureTree'); - $this->Application->deleteDBCache('template_mapping'); + $this->Application->rebuildDBCache('cms_menu', kCache::REBUILD_LATER, CacheSettings::$cmsMenuRebuildTime); + $this->Application->rebuildDBCache('StructureTree', kCache::REBUILD_LATER, CacheSettings::$structureTreeRebuildTime); + $this->Application->rebuildDBCache('template_mapping', kCache::REBUILD_LATER, CacheSettings::$templateMappingRebuildTime); } } @@ -1966,6 +1978,7 @@ } $object =& $event->getObject(); + /* @var $object kDBItem */ // remove this category & it's children from dropdown $sql = 'SELECT '.$object->IDField.'