From aa62c9f9674d5dcf3d47f788f18855f87493f276 Mon Sep 17 00:00:00 2001 From: Ivan Dziuba Date: Sat, 24 Oct 2020 07:48:07 -0400 Subject: [PATCH] Bug 26614 - Diacritics taken into account in facet sorting --- C4/Search.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/C4/Search.pm b/C4/Search.pm index f2e73ee5a4..f2d0a73eb9 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -40,6 +40,8 @@ use Business::ISBN; use MARC::Record; use MARC::Field; use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $DEBUG); +use utf8; +use Text::Unaccent; BEGIN { $DEBUG = ($ENV{DEBUG}) ? 1 : 0; @@ -592,7 +594,7 @@ sub getRecords { # This sorts the facets into alphabetical order if (@facets_loop) { foreach my $f (@facets_loop) { - $f->{facets} = [ sort { uc($a->{facet_label_value}) cmp uc($b->{facet_label_value}) } @{ $f->{facets} } ]; + $f->{facets} = [ sort { uc(unac_string("UTF-8", $a->{facet_label_value})) cmp uc(unac_string("UTF-8", $b->{facet_label_value})) } @{ $f->{facets} } ]; } } -- 2.17.1