Index: branches/5.2.x/core/units/categories/categories_event_handler.php =================================================================== diff -u -N -r15260 -r15268 --- branches/5.2.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 15260) +++ branches/5.2.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 15268) @@ -1,6 +1,6 @@ GetID(); $this->Conn->Query($sql); + + // delete direct subscriptions to category, that was deleted + $sql = 'SELECT SubscriptionId + FROM ' . TABLE_PREFIX . 'SystemEventSubscriptions + WHERE CategoryId = ' . $object->GetID(); + $ids = $this->Conn->GetCol($sql); + + if ( $ids ) { + $temp_handler = $this->Application->recallObject('system-event-subscription_TempHandler', 'kTempTablesHandler'); + /* @var $temp_handler kTempTablesHandler */ + + $temp_handler->DeleteItems('system-event-subscription', '', $ids); + } } /**