From 9cca1547935519081f27c593c9d1dfc74e3e0fd3 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Tue, 26 Sep 2023 22:40:01 +0000 Subject: [PATCH] Bug 34908: Sort item types alphabetically by description when adding a new empty record as an order to a basket To test: 1. Go to Koha administration -> Item types. Add a new item type "B" with the description "Test" so it will be obvious if it is sorted by the code "B" instead of the description "Test". 2. Go to Acquisitions. Add to a basket from a new empty record 3. In the Catalog details section, note the Item type dropdown. Confirm your "Test" item type, is showing near the top of the list, indicating it has been sorted based on the code "B" 4. Apply patch and restart services. Refresh the page. 5. Open the Item type dropdown again and confirm your "Test" item type is showing in the expected alphabetical order. NC amended patch - tidied Sponsored-by: South Taranaki District Council Signed-off-by: David Nind Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 0ef83c041d55cb95a4fd839101135126c3d9854a) Signed-off-by: Fridolin Somers (cherry picked from commit 0237ad8eb48d7bdeac9648d37ebdbccbb87cf2bc) Signed-off-by: Matt Blenkinsop --- acqui/neworderempty.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index 438e5755e5..8658c8d944 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -360,7 +360,7 @@ if ($basketobj->effective_create_items eq 'ordering' && !$ordernumber) { ); } -my @itemtypes = Koha::ItemTypes->search->as_list; +my @itemtypes = Koha::ItemTypes->search( {}, { order_by => { -asc => "description" } } )->as_list; if ( defined $from_subscriptionid ) { # Get the last received order for this subscription -- 2.39.5