From ffc434ba79aafc3a10da41648c01d2a5dde4acf2 Mon Sep 17 00:00:00 2001 From: Lari Strand Date: Wed, 29 May 2024 13:53:22 +0300 Subject: [PATCH] Bug 36982: Collections facet does not get alphabetized based on collection descriptions Signed-off-by: David Nind Signed-off-by: Lucas Gass Signed-off-by: Katrin Fischer (cherry picked from commit 83762f6feec027cf6acff2022c9eb528ac1507d8) Signed-off-by: Lucas Gass (cherry picked from commit 5d059209f7e936500d706901d7057e287a90a85a) Signed-off-by: Fridolin Somers --- Koha/SearchEngine/Elasticsearch/Search.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm index 933b52f79d..41c1b8d060 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/Koha/SearchEngine/Elasticsearch/Search.pm @@ -469,10 +469,12 @@ sub _convert_facets { my @libraries = Koha::Libraries->search->as_list; my $library_names = { map { $_->branchcode => $_->branchname } @libraries }; my @locations = Koha::AuthorisedValues->search( { category => 'LOC' } )->as_list; + my @collections = Koha::AuthorisedValues->search( { category => 'CCODE' } )->as_list; my $opac = C4::Context->interface eq 'opac' ; my %special = ( itype => { map { $_->itemtype => $_->description } @itypes }, location => { map { $_->authorised_value => ( $opac ? ( $_->lib_opac || $_->lib ) : $_->lib ) } @locations }, + ccode => { map { $_->authorised_value => ( $opac ? ( $_->lib_opac || $_->lib ) : $_->lib ) } @collections }, holdingbranch => $library_names, homebranch => $library_names ); -- 2.39.5