Skip to content

Commit ab83f34

Browse files
committed
fix(dropdownfield): group restriction inaccurate
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
1 parent 26d8352 commit ab83f34

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

inc/field/dropdownfield.class.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -614,14 +614,13 @@ private function getMyGroups($userID) {
614614
$_SESSION['glpiactive_entity_recursive']
615615
)
616616
]);
617-
if ($result->count() === 0) {
618-
return [];
619-
}
617+
$groups = [];
620618
foreach ($result as $data) {
621619
$a_groups = $dbUtil->getAncestorsOf("glpi_groups", $data["groups_id"]);
622620
$a_groups[$data["groups_id"]] = $data["groups_id"];
621+
$groups = array_merge($groups, $a_groups);
623622
}
624-
return $a_groups;
623+
return $groups;
625624
}
626625

627626
public function equals($value): bool {

0 commit comments

Comments
 (0)