From 412eed549f50329c3bc4a3af92ef873e76d528f0 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 10 Jan 2022 13:56:30 +0100 Subject: [PATCH] Bug 29562: Test $item instead of $itemNum --- opac/opac-reserve.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index c759e4fd362..fc0cba21398 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -239,7 +239,7 @@ if ( $query->param('place_reserve') ) { my $item = $itemNum ? Koha::Items->find( $itemNum ) : undef; # When choosing a specific item, the default pickup library should be dictated by the default hold policy - if ( ! C4::Context->preference("OPACAllowUserToChooseBranch") && $itemNum ) { + if ( ! C4::Context->preference("OPACAllowUserToChooseBranch") && $item ) { my $type = $item->effective_itemtype; my $rule = GetBranchItemRule( $patron->branchcode, $type ); @@ -254,7 +254,7 @@ if ( $query->param('place_reserve') ) { } #item may belong to a host biblio, if yes change biblioNum to hosts bilbionumber - if ( $itemNum ) { + if ( $item ) { my $hostbiblioNum = $item->biblio->biblionumber; if ( $hostbiblioNum ne $biblioNum ) { $biblioNum = $hostbiblioNum; @@ -276,7 +276,7 @@ if ( $query->param('place_reserve') ) { my $rank = $biblioData->{rank}; my $patron = Koha::Patrons->find( $borrowernumber ); - if ( $itemNum ) { + if ( $item ) { $canreserve = 1 if CanItemBeReserved( $patron, $item, $branch )->{status} eq 'OK'; } else { -- 2.25.1