From 18956c616326f77aeca0c20f185a3215a19f80df Mon Sep 17 00:00:00 2001 From: Marvin Beym Date: Tue, 10 Feb 2026 07:58:58 +0100 Subject: [PATCH 1/2] Fix duplicate autocomplete options returned in user search --- components/ILIAS/User/src/Search/class.EndpointGUI.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/ILIAS/User/src/Search/class.EndpointGUI.php b/components/ILIAS/User/src/Search/class.EndpointGUI.php index 64eea85b7c1a..89be9c512f5d 100644 --- a/components/ILIAS/User/src/Search/class.EndpointGUI.php +++ b/components/ILIAS/User/src/Search/class.EndpointGUI.php @@ -100,7 +100,7 @@ private function buildResponse(): string ]) ); - $response = array_map( + $response = array_unique(array_map( static fn(AutocompleteItem $v) => $v->getTagArray(), array_merge( $this->endpoint_configurator->getAdditionalAnswerElements( @@ -113,7 +113,7 @@ private function buildResponse(): string $autocomplete_query ) ) - ); + ), SORT_REGULAR); usort( $response, From 93366e6fea050c6dc72571ea7a4148d63f496e32 Mon Sep 17 00:00:00 2001 From: Marvin Beym Date: Thu, 12 Feb 2026 09:40:46 +0100 Subject: [PATCH 2/2] Fix duplicate autocomplete options returned in user search --- .../ILIAS/User/src/Search/class.EndpointGUI.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/components/ILIAS/User/src/Search/class.EndpointGUI.php b/components/ILIAS/User/src/Search/class.EndpointGUI.php index 89be9c512f5d..d8b84bd033b4 100644 --- a/components/ILIAS/User/src/Search/class.EndpointGUI.php +++ b/components/ILIAS/User/src/Search/class.EndpointGUI.php @@ -100,8 +100,7 @@ private function buildResponse(): string ]) ); - $response = array_unique(array_map( - static fn(AutocompleteItem $v) => $v->getTagArray(), + $response = array_reduce( array_merge( $this->endpoint_configurator->getAdditionalAnswerElements( $this->current_user, @@ -112,8 +111,16 @@ private function buildResponse(): string $this->field_configuration_repository, $autocomplete_query ) - ) - ), SORT_REGULAR); + ), + static function (array $carry, AutocompleteItem $item): array { + $tag_array = $item->getTagArray(); + $carry[$tag_array['display']] = $tag_array; + return $carry; + }, + [] + ); + + $response = array_values($response); usort( $response,