From 579fb8cf3c5a321b3821cbe0ef84612b35b355dd Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Wed, 16 Oct 2024 10:24:52 +0200 Subject: [PATCH] Bug 38136: Fix call to search_with_localization with branchcode param It was the only place where this parameter was used --- Koha/UI/Form/Builder/Item.pm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Koha/UI/Form/Builder/Item.pm b/Koha/UI/Form/Builder/Item.pm index 2ace11b403..9176155899 100644 --- a/Koha/UI/Form/Builder/Item.pm +++ b/Koha/UI/Form/Builder/Item.pm @@ -209,14 +209,11 @@ sub generate_subfield_form { } elsif ( $subfield->{authorised_value} eq "itemtypes" ) { push @authorised_values, ""; - my $itemtypes; + my $itemtypes = Koha::ItemTypes->new; if ($branch_limit) { - $itemtypes = Koha::ItemTypes->search_with_localization( - { branchcode => $branch_limit } ); - } - else { - $itemtypes = Koha::ItemTypes->search_with_localization; + $itemtypes = $itemtypes->search_with_library_limits({}, {}, $branch_limit); } + $itemtypes = $itemtypes->order_by_translated_description; while ( my $itemtype = $itemtypes->next ) { push @authorised_values, $itemtype->itemtype; $authorised_lib{ $itemtype->itemtype } = -- 2.39.2