#10152 fixed error 500 message notification groups

This commit is contained in:
Daniel Cebrian 2023-01-17 11:17:20 +01:00
parent bc5e1c7541
commit e16ef7063a
1 changed files with 12 additions and 4 deletions

View File

@ -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)) {