Bug 36982: Collections facet does not get alphabetized based on collection descriptions

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 83762f6fee)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5d059209f7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Lari Strand 2024-05-29 13:53:22 +03:00 committed by Fridolin Somers
parent 39145f998d
commit ffc434ba79
1 changed files with 2 additions and 0 deletions

View File

@ -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
);