From eebcc21f156024a2fc8c6cfe6e232dd644ac845a Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Thu, 8 Feb 2024 11:00:05 +0100 Subject: [PATCH] fix(dropdownfield): incomplete group restriction --- inc/field/dropdownfield.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/field/dropdownfield.class.php b/inc/field/dropdownfield.class.php index 077a43394..725de4de2 100644 --- a/inc/field/dropdownfield.class.php +++ b/inc/field/dropdownfield.class.php @@ -594,8 +594,9 @@ private function getMyGroups($userID) { if ($result->count() === 0) { return []; } + $a_groups = []; foreach ($result as $data) { - $a_groups = $dbUtil->getAncestorsOf("glpi_groups", $data["groups_id"]); + $a_groups = $a_groups + $dbUtil->getAncestorsOf("glpi_groups", $data["groups_id"]); $a_groups[$data["groups_id"]] = $data["groups_id"]; } return $a_groups;