Index: branches/5.2.x/core/units/scheduled_tasks/scheduled_task_eh.php =================================================================== diff -u -N -r15033 -r15065 --- branches/5.2.x/core/units/scheduled_tasks/scheduled_task_eh.php (.../scheduled_task_eh.php) (revision 15033) +++ branches/5.2.x/core/units/scheduled_tasks/scheduled_task_eh.php (.../scheduled_task_eh.php) (revision 15065) @@ -1,6 +1,6 @@ Name == 'OnMassDelete' && $type == 'before') { - if ($this->Application->isDebugMode()) { + if ( $event->Name == 'OnMassDelete' && $type == 'before' ) { + if ( $this->Application->isDebugMode() ) { // allow to delete system scheduled tasks in debug mode - return ; + return; } $ids = $event->getEventParam('ids'); - if ($ids) { + + if ( $ids ) { $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField'); $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); $sql = 'SELECT ' . $id_field . ' FROM ' . $table_name . ' WHERE ' . $id_field . ' IN (' . implode(',', $ids) . ') AND Type <> ' . ScheduledTask::TYPE_SYSTEM; - $allowed_ids = $this->Conn->GetCol($sql); - - $event->setEventParam('ids', $allowed_ids); + $event->setEventParam('ids', $this->Conn->GetCol($sql)); } } }