Index: branches/unlabeled/unlabeled-1.22.2/core/units/categories/categories_event_handler.php =================================================================== diff -u -r5628 -r5643 --- branches/unlabeled/unlabeled-1.22.2/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 5628) +++ branches/unlabeled/unlabeled-1.22.2/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 5643) @@ -253,11 +253,11 @@ function OnBeforeDeleteFromLive(&$event) { $id = $event->getEventParam('id'); - + // loding anyway, because this object is needed by "c-perm:OnBeforeDeleteFromLive" event $temp_object =& $event->getObject( Array('skip_autoload' => true) ); $temp_object->Load($id); - + if ($id == 0) { if ($temp_object->isLoaded()) { // new category -> update chache (not loaded when "Home" category) @@ -269,7 +269,7 @@ // existing category was edited, check if in-cache fields are modified $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', 'ItemTemplate'); foreach ($cached_fields as $cached_field) { @@ -293,7 +293,7 @@ if ($object->IsRoot()) { $event->setEventParam('master_ids', Array(0)); } - + parent::OnSave($event); if ($event->status == erSUCCESS && $this->Application->RecallVar('PermCache_UpdateRequired')) { // "catalog" should be in opener stack by now @@ -336,6 +336,7 @@ */ function OnCopy(&$event) { + $this->Application->RemoveVar('clipboard'); $clipboard_helper =& $this->Application->recallObject('ClipboardHelper'); $clipboard_helper->setClipboard($event, 'copy', $this->StoreSelectedIDs($event)); } @@ -347,6 +348,7 @@ */ function OnCut(&$event) { + $this->Application->RemoveVar('clipboard'); $clipboard_helper =& $this->Application->recallObject('ClipboardHelper'); $clipboard_helper->setClipboard($event, 'cut', $this->StoreSelectedIDs($event)); } @@ -362,7 +364,7 @@ foreach ($clipboard as $prefix => $clipboard_data) { $paste_event = new kEvent($prefix.':OnPaste', Array('clipboard_data' => $clipboard_data)); $this->Application->HandleEvent($paste_event); - + $event->redirect = $paste_event->redirect; $event->redirect_params = $paste_event->redirect_params; $event->status = $paste_event->status; @@ -381,7 +383,7 @@ } $clipboard_data = $event->getEventParam('clipboard_data'); - + if (!$clipboard_data['cut'] && !$clipboard_data['copy']) { return false; } @@ -390,13 +392,13 @@ if ($clipboard_data['cut']) { $recursive_helper->MoveCategories($clipboard_data['cut'], $this->Application->GetVar('m_cat_id')); } - + if ($clipboard_data['copy']) { foreach ($clipboard_data['copy'] as $id) { $recursive_helper->PasteCategory($id); } } - + if ($clipboard_data['cut'] || $clipboard_data['copy']) { $event->redirect = 'categories/cache_updater'; }