When placing hold, the pickup libraries are not sorted by name but by code.
Created attachment 120039 [details] [review] Bug 28202: Pickup libraries must be sorted by name when placing hold When placing hold, the pickup libraries are not sorted by name but by code. You can see in other places : pickup_locations() calls Koha::Libraries->search with { order_by => ['branchname'] } Test plan : 1) Go to staff interface 2) Create a new libary with code 'AAA' and name 'ZZZ'. 2) Select a record 3) Begin placing hold 4) Look at list in "Pickup at:" => Without patch library 'ZZZ' is first => With patch library 'ZZZ' is last
Test coverage is missing.
Created attachment 120049 [details] [review] Bug 28202: Unit test Run prove t/db_dependent/Koha/Biblio.t Note that sort must be case insensitive.
Created attachment 120050 [details] [review] Bug 28202: Pickup libraries must be sorted by name when placing hold When placing hold, the pickup libraries are not sorted by name but by code. You can see in other places : pickup_locations() calls Koha::Libraries->search with { order_by => ['branchname'] } Test plan : 1) Go to staff interface 2) Create a new libary with code 'AAA' and name 'ZZZ'. 2) Select a record 3) Begin placing hold 4) Look at list in "Pickup at:" => Without patch library 'ZZZ' is first => With patch library 'ZZZ' is last
Created attachment 120142 [details] [review] Bug 28202: Unit test Run prove t/db_dependent/Koha/Biblio.t Note that sort must be case insensitive. Signed-off-by: David Nind <david@davidnind.com>
Created attachment 120143 [details] [review] Bug 28202: Pickup libraries must be sorted by name when placing hold When placing hold, the pickup libraries are not sorted by name but by code. You can see in other places : pickup_locations() calls Koha::Libraries->search with { order_by => ['branchname'] } Test plan : 1) Go to staff interface 2) Create a new libary with code 'AAA' and name 'ZZZ'. 2) Select a record 3) Begin placing hold 4) Look at list in "Pickup at:" => Without patch library 'ZZZ' is first => With patch library 'ZZZ' is last Signed-off-by: David Nind <david@davidnind.com>
Testing notes (koha-testing-docker): - I initially thought the sort order was working correctly before apply the patch - However, koha-testing-docker sample data is nice and orderly and library codes and library names will display in the correct alphabetical order by either code or library name - For testing I created libraries using code AAA for a library called 'Z Library', for code ZZZ for a library called "A Library" - Then you can see that it is sorting by the library code rather than the library name before the patch is applied
Created attachment 120236 [details] [review] Bug 28202: Unit test Run prove t/db_dependent/Koha/Biblio.t Note that sort must be case insensitive. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 120237 [details] [review] Bug 28202: Pickup libraries must be sorted by name when placing hold When placing hold, the pickup libraries are not sorted by name but by code. You can see in other places : pickup_locations() calls Koha::Libraries->search with { order_by => ['branchname'] } Test plan : 1) Go to staff interface 2) Create a new libary with code 'AAA' and name 'ZZZ'. 2) Select a record 3) Begin placing hold 4) Look at list in "Pickup at:" => Without patch library 'ZZZ' is first => With patch library 'ZZZ' is last Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Nice improvement, thanks Fridolin.. Passing QA
Pushed to master for 21.05, thanks to everybody involved!
Pushed to 20.11.x for 20.11.06
*** Bug 26925 has been marked as a duplicate of this bug. ***
Pushed to 20.05.x for 20.05.12
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.