From 48865d8a62fce889fc343df76bc7752b4c384a8f Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 22 Feb 2010 17:01:58 +0000 Subject: [PATCH] 2010-02-22 Miguel de Dios * include/functions_alerts.php: fix when try delete only the alerts from alert policies form. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2397 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/functions_alerts.php | 16 +++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) 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',