Index: branches/RC/core/units/categories/categories_event_handler.php =================================================================== diff -u -r9705 -r9824 --- branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 9705) +++ branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 9824) @@ -557,9 +557,24 @@ return; } -// $event->status = erSUCCESS; - $ids = $this->StoreSelectedIDs($event); + $to_delete = array(); + if ($recycle_bin = $this->Application->ConfigValue('RecycleBinFolder')) { + $rb = $this->Application->recallObject('c.recycle', null, array('skip_autoload' => true)); + $rb->Load($recycle_bin); + $cat = $event->getObject(array('skip_autoload'=>true)); + foreach ($ids as $id) { + $cat->Load($id); + if (preg_match('/^'.preg_quote($rb->GetDBField('ParentPath'),'/').'/', $cat->GetDBField('ParentPath'))) { + $to_delete[] = $id; + continue; + } + $cat->SetDBField('ParentId', $recycle_bin); + $cat->Update(); + } + $ids = $to_delete; + $event->redirect = 'in-portal/categories/cache_updater'; + } $event->setEventParam('ids', $ids); $this->customProcessing($event, 'before');