Bug 34232: Make dropdown on additem page rescept display order

To test:
1. EnableItemGroups
2. Find a record and add some new item groups with different display orders
3. Now edit an item on the record and scroll down to the dropdown underneath "+ Add to item group"
4. Notice that the values in the dropdown do not respect the display order.
5. Apply patch and restart_all
6. The display order should now be respected

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Lucas Gass 2023-07-07 19:31:15 +00:00 committed by Tomas Cohen Arazi
parent ca0d91aed4
commit 8065e3515a
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -752,11 +752,13 @@ if( my $default_location = C4::Context->preference('NewItemsDefaultLocation') )
} }
my @ig = Koha::Biblio::ItemGroups->search({ biblio_id => $biblionumber })->as_list(); my @ig = Koha::Biblio::ItemGroups->search({ biblio_id => $biblionumber })->as_list();
#sort by display order
my @sorted_ig = sort { $a->display_order <=> $b->display_order } @ig;
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. # what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
$template->param( $template->param(
biblio => $biblio, biblio => $biblio,
items => \@items, items => \@items,
item_groups => \@ig, item_groups => \@sorted_ig,
item_header_loop => \@header_value_loop, item_header_loop => \@header_value_loop,
subfields => $subfields, subfields => $subfields,
itemnumber => $itemnumber, itemnumber => $itemnumber,