Bug 41879: (follow-up) Bail with error code when no items on target bib

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Lucas Gass 2026-07-17 20:16:11 +00:00
parent c9e5e6c5cb
commit 670c4cc35a
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 4 additions and 1 deletions

View File

@ -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 ) ) {