From bc5e1c754120aee86b670cad95ba5997e74c0bb5 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 17 Jan 2023 11:05:43 +0100 Subject: [PATCH 1/2] #10152 fixed error 500 in notifications group --- pandora_console/include/functions_users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_users.php b/pandora_console/include/functions_users.php index ad3e6ac3b2..c5826ee36a 100755 --- a/pandora_console/include/functions_users.php +++ b/pandora_console/include/functions_users.php @@ -142,7 +142,7 @@ function users_get_groups_for_select( null ); - if ($id_groups !== null) { + if ($id_groups !== null && empty($id_groups) === false) { $children = groups_get_children($id_groups); foreach ($children as $child) { unset($user_groups[$child['id_grupo']]); From e16ef7063a51f14f83fc06e22461e1e81de2a7ff Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 17 Jan 2023 11:17:20 +0100 Subject: [PATCH 2/2] #10152 fixed error 500 message notification groups --- pandora_console/include/functions_users.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_users.php b/pandora_console/include/functions_users.php index c5826ee36a..8bb4264bc2 100755 --- a/pandora_console/include/functions_users.php +++ b/pandora_console/include/functions_users.php @@ -143,12 +143,20 @@ function users_get_groups_for_select( ); if ($id_groups !== null && empty($id_groups) === false) { - $children = groups_get_children($id_groups); - foreach ($children as $child) { - unset($user_groups[$child['id_grupo']]); + $children = []; + foreach ($id_groups as $key => $id_group) { + $children[] = groups_get_children($id_group); } - unset($user_groups[$id_groups]); + if (empty($children) === false) { + foreach ($children as $child) { + unset($user_groups[$child['id_grupo']]); + } + } + + foreach ($id_groups as $key => $id_group) { + unset($user_groups[$id_group]); + } } if (empty($user_groups)) {