Index: branches/unlabeled/unlabeled-1.25.2/core/units/categories/categories_event_handler.php =================================================================== diff -u -r7048 -r7057 --- branches/unlabeled/unlabeled-1.25.2/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 7048) +++ branches/unlabeled/unlabeled-1.25.2/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 7057) @@ -40,7 +40,7 @@ } $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField'); - + if (strlen($selected_ids) > 0) { $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); $sql = 'SELECT '.$id_field.', CreatedById @@ -59,7 +59,7 @@ $perm_value = true; $perm_helper =& $this->Application->recallObject('PermissionsHelper'); /* @var $perm_helper kPermissionsHelper */ - + foreach ($items as $item_id => $item_data) { if ($perm_helper->ModifyCheckPermission($item_data['CreatedById'], $item_data[$id_field], $event->Prefix) == 0) { // one of items selected has no permission @@ -94,10 +94,10 @@ $object =& $event->getObject(); /* @var $object kDBList */ - + // hide categories with status = 4 (system categories) $object->addFilter('system_categories', '%1$s.Status <> 4'); - + if ( $event->getEventParam('parent_cat_id') ) { $parent_cat_id = $event->getEventParam('parent_cat_id'); @@ -309,15 +309,24 @@ */ function OnAfterCopyToLive(&$event) { + $parent_path = false; + $object =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true, 'live_table' => true)); + $object->Load($event->getEventParam('id')); if ($event->getEventParam('temp_id') == 0) { - $object =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true, 'live_table' => true)); - $object->Load($event->getEventParam('id')); if ($object->isLoaded()) { // update path only for real categories (not including "Home" root category) $fields_hash = Array('ParentPath' => $object->buildParentPath()); $this->Conn->doUpdate($fields_hash, $object->TableName, 'CategoryId = '.$object->GetID()); + $parent_path = $fields_hash['ParentPath']; } } + else { + $parent_path = $object->GetDBField('ParentPath'); + } + if ($parent_path) { + $cache_updater =& $this->Application->recallObject('kPermCacheUpdater', null, array('strict_path' => $parent_path)); + $cache_updater->OneStepRun(); + } } /**