From 54b9e0d87b3dafeb2295d4a2d3c62dd0402b137b Mon Sep 17 00:00:00 2001 From: Christophe Maudoux Date: Sat, 23 Jan 2021 23:20:50 +0100 Subject: [PATCH] Sort values (#1976) --- .../lib/Lemonldap/NG/Portal/Plugins/FindUser.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/FindUser.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/FindUser.pm index 5e6f337d5..6b38dc84e 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/FindUser.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/FindUser.pm @@ -140,8 +140,8 @@ sub buildForm { $nbr /= 2; $self->logger->debug( "Building $key with type 'select' and $nbr entries..."); - @$choices = map { { key => $_, value => $hash{$_} } } - sort keys %hash; + @$choices = sort { $a->{value} cmp $b->{value} } + map { { key => $_, value => $hash{$_} } } keys %hash; { select => 1, key => $key, @@ -158,7 +158,7 @@ sub buildForm { value => $values[0] }; } - } sort keys %{ $self->conf->{findUserSearchingAttributes} }; + } keys %{ $self->conf->{findUserSearchingAttributes} }; return $fields; }