From 50436c7fbc029912bd20ad97a726acd3249e0a49 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 4 Nov 2020 14:05:06 +0000 Subject: [PATCH] Bug 26925: Sort pickup locations for biblio Currently we fetch the pickup locations for each item on the biblio, then we remove duplicates. Each items locations are sorted alphabetically, however, we don't ensure the final list is ordered To test: 1 - Find a title with items from two different libraries 2 - Create two library groups and select 'is local hold group' 3 - Place the libraries of the items in separate groups with differing libraries 4 - Attempt to place a hold for the title in the staff client 5 - Note the "Pickup at" list is not in alphabetical order 6 - Apply patch 7 - Restart all and reload 8 - Pickup locations are now sorted correctly --- Koha/Biblio.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index 29c7d1edb4..c6326f4907 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -227,6 +227,8 @@ sub pickup_locations { @pickup_locations = grep { !$seen{ $_->branchcode }++ } @pickup_locations; + @pickup_locations = sort { uc( $a->branchname) cmp uc( $b->branchname) } @pickup_locations; + return \@pickup_locations; } -- 2.11.0