From 014efe3dd63d12b6eba88126bb5ea31a07897643 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 10 Jun 2020 12:03:20 +0200 Subject: [PATCH] Bug 25701: (bug 14419 follow-up) Always display facet groups in the same order It seems that this regression comes from bug 14419, but I have not found a logic reason behind that. This patch restores the behaviour we always had: facet groups must be displayed in a given order: the Zebra index (au, ccode, holdingbranch, etc.) Test plan: Apply this patch, restart all and confirm that the facets are not moving up and down when you refresh your search result page. QA note: I think the following line must be removed @facets_loop = sort {defined $a->{expand} && defined $b->{expand} && $a->{expand} cmp $b->{expand}} @facets_loop; Signed-off-by: David Nind Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart (cherry picked from commit d6696944267ca1afd7682193ddf3680a905a773d) Signed-off-by: Lucas Gass (cherry picked from commit 91ad11021609bc15e9099f7fe9d4afeb69786647) Signed-off-by: Aleisha Amohia (cherry picked from commit dcfb394e03e3ccb56b2f6bc21e481cfd001548a1) Signed-off-by: Victor Grousset/tuxayo --- C4/Search.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 4c07570b4e..560c4d92fc 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -513,8 +513,7 @@ sub getRecords { # BUILD FACETS if ( $servers[ $i - 1 ] =~ /biblioserver/ ) { for my $link_value ( - sort { $facets_counter->{$b} <=> $facets_counter->{$a} } - keys %$facets_counter + sort { $a cmp $b } keys %$facets_counter ) { my @this_facets_array; -- 2.39.5