From ae1d2de2f6cfb01bc80b321f34d0777d51a66871 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 Signed-off-by: Jonathan Druart --- 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