diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 6204ab541e..6cb27c67c8 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2010-02-22 Miguel de Dios + + * include/functions_alerts.php: fix when try delete only the alerts from + alert policies form. + 2010-02-22 Miguel de Dios * images/groups_small/*.ok.png, images/groups_small/*.default.png, diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index 5f5d836857..ce89d3994d 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -410,13 +410,15 @@ function delete_alert_agent_module ($id_alert_agent_module, $filter = false) { if ($id_alert_agent_module) $filter['id'] = $id_alert_agent_module; - $idAlertCompunds = get_db_all_rows_sql('SELECT id_alert_compound - FROM talert_compound_elements - WHERE id_alert_template_module = ' . $id_alert_agent_module); - - if ($idAlertCompunds !== false) { - foreach($idAlertCompunds as $id) - delete_alert_compound($id); + if ($id_alert_agent_module !== false) { + $idAlertCompunds = get_db_all_rows_sql('SELECT id_alert_compound + FROM talert_compound_elements + WHERE id_alert_template_module = ' . $id_alert_agent_module); + + if ($idAlertCompunds !== false) { + foreach($idAlertCompunds as $id) + delete_alert_compound($id); + } } return (@process_sql_delete ('talert_template_modules',