From 670c4cc35ad67995bd0fc439d7a726b1fef88717 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 17 Jul 2026 20:16:11 +0000 Subject: [PATCH] Bug 41879: (follow-up) Bail with error code when no items on target bib Signed-off-by: Lucas Gass --- Koha/Hold.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Koha/Hold.pm b/Koha/Hold.pm index e8a96460dd..28cddfcac6 100644 --- a/Koha/Hold.pm +++ b/Koha/Hold.pm @@ -222,7 +222,10 @@ sub move_hold { $new_biblionumber = $args->{new_biblionumber}; # for record level holds we must check to make sure there is at least 1 item on the record that can fulfill the new hold - my @items = Koha::Items->search( { biblionumber => $new_biblionumber } )->as_list; + my @items = Koha::Items->search( { biblionumber => $new_biblionumber } )->as_list; + + return { success => 0, error => 'noItemsOnBib' } unless @items; + my $valid_pickup_item = 0; foreach my $candidate_item (@items) { if ( $self->_pickup_valid_for_item( $candidate_item, $patron ) ) {