From 742cbcb5c599e8071a3272b2882e61be6552967e Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 29 Oct 2020 17:54:40 +0100 Subject: [PATCH 1/2] fix group alert report --- pandora_console/include/functions_alerts.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index 2566e265be..5f3731164d 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -2871,17 +2871,8 @@ function alerts_get_agent_modules( ); $agent_modules = db_get_all_rows_sql($sql); } else { - $groups = groups_get_children($id_grupo, true); - if (empty($groups) === false) { - $groups = array_reduce( - $groups, - function ($carry, $item) { - $carry[] = $item['id_grupo']; - return $carry; - }, - [$id_grupo] - ); - + $groups = groups_get_children_ids($id_grupo, true); + if (count($groups) > 1) { $sql = sprintf( 'SELECT distinct(atm.id_agent_module) FROM talert_template_modules atm From 45e8efa089ec515370e498397d94354f2a35c064 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 29 Oct 2020 18:47:34 +0100 Subject: [PATCH 2/2] minor fix --- pandora_console/include/functions_alerts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index 5f3731164d..74a024d866 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -2872,7 +2872,7 @@ function alerts_get_agent_modules( $agent_modules = db_get_all_rows_sql($sql); } else { $groups = groups_get_children_ids($id_grupo, true); - if (count($groups) > 1) { + if (empty($groups) === false) { $sql = sprintf( 'SELECT distinct(atm.id_agent_module) FROM talert_template_modules atm