@@ -, +, @@ Bug 14828: Use Koha::ItemType[s] everywhere C4::ItemType was used -my @item_types = C4::ItemType->all; -my @for_loan = grep { $_->{notforloan} == 0 } @item_types - or BAIL_OUT("No adequate itemtype"); -my $itemtype = $for_loan[0]->{itemtype}; +my $itemtype = Koha::ItemTypes->search({ notforloan => 1 })->next; +$itemtype or BAIL_OUT("No adequate itemtype"); #FIXME Should be $itemtype = $itemtype->itemtype prove t/db_dependent/HoldsQueue.t --- t/db_dependent/HoldsQueue.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/t/db_dependent/HoldsQueue.t +++ a/t/db_dependent/HoldsQueue.t @@ -61,8 +61,8 @@ my $borrower_branchcode = $borrower->{branchcode}; my @branchcodes = ( $library1->{branchcode}, $library2->{branchcode}, $library3->{branchcode} ); my @other_branches = ( $library2->{branchcode}, $library3->{branchcode} ); my $least_cost_branch_code = pop @other_branches; -my $itemtype = Koha::ItemTypes->search({ notforloan => 1 })->next; -$itemtype or BAIL_OUT("No adequate itemtype"); #FIXME Should be $itemtype = $itemtype->itemtype +my $itemtype = Koha::ItemTypes->search({ notforloan => 0 })->next->itemtype; +$itemtype or BAIL_OUT("No adequate itemtype"); #Set up the stage # Sysprefs and cost matrix --