From 79c2f0ac1a15e4f2da4cd40eb2881ab75c6fc30f Mon Sep 17 00:00:00 2001 From: lmstrand Date: Thu, 23 May 2024 16:46:10 +0300 Subject: [PATCH] Bug 36947 - Diacritics and lower case letters not taken into account when facets are alphabetized --- Koha/SearchEngine/Elasticsearch/Search.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm index 54e6e644dc..3c0d828d4f 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/Koha/SearchEngine/Elasticsearch/Search.pm @@ -53,6 +53,7 @@ use MARC::Record; use MARC::File::XML; use MIME::Base64 qw( decode_base64 ); use JSON; +use Unicode::Normalize; Koha::SearchEngine::Elasticsearch::Search->mk_accessors(qw( store )); @@ -503,7 +504,7 @@ sub _convert_facets { } if( C4::Context->preference('FacetOrder') eq 'Alphabetical' ){ @{ $facet->{facets} } = - sort { $a->{facet_label_value} cmp $b->{facet_label_value} } @{ $facet->{facets} }; + sort { NFKD(uc($a->{facet_label_value})) cmp NFKD(uc($b->{facet_label_value})) } @{ $facet->{facets} }; } push @facets, $facet if exists $facet->{facets}; } -- 2.34.1