From 0ee13cec67dc4683d1df832133a9403454e426fa 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 24e784c9612..4e7ebb72ac6 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -241,7 +241,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 ); @@ -256,7 +256,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; @@ -278,7 +278,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