From 13ca80c20bb7461b1007bdbfddfde2ae3a5d2d1f Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 15 Mar 2018 12:53:13 +0000 Subject: [PATCH] Bug 18213: (follow-up) Correctly sort facets Previously we sorted alphabetically - that works for 1-9. With a 10th facet category we should sort numerically Signed-off-by: Nicolas Legrand Signed-off-by: Alex Arnaud Signed-off-by: Josef Moravec Signed-off-by: Nick Clemens --- Koha/SearchEngine/Elasticsearch/Search.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm index d8b8469f6e..a4b4e84cae 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/Koha/SearchEngine/Elasticsearch/Search.pm @@ -509,7 +509,7 @@ sub _convert_facets { push @facets, $facet if exists $facet->{facets}; } - @facets = sort { $a->{order} cmp $b->{order} } @facets; + @facets = sort { $a->{order} <=> $b->{order} } @facets; return \@facets; } -- 2.39.5