From 0c8dda1dcc8cb1d074cde223ccd43b0b0933332d Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Mon, 25 Sep 2023 10:21:36 +0000 Subject: [PATCH] Bug 34836: Add patron check to isbd and marc detail pages Test plan: - Go to circulation rules and set On shelf holds allowed to If all unavailable - Log out - Visit a MARC detail or ISBD detail bib record on OPAC: http://localhost:8080/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=76 http://localhost:8080/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=76 - Notice it blows up with error 500, on both occasions - Apply patch. Repeat. Signed-off-by: David Nind Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 4fadf73a95f82ca7abd3d27f490a51825949f7b0) Signed-off-by: Fridolin Somers --- opac/opac-ISBDdetail.pl | 2 +- opac/opac-MARCdetail.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl index fb7fc05bf5..86685f9239 100755 --- a/opac/opac-ISBDdetail.pl +++ b/opac/opac-ISBDdetail.pl @@ -178,7 +178,7 @@ my $res = GetISBDView({ my $items = $biblio->items; while ( my $item = $items->next ) { - $can_item_be_reserved = $can_item_be_reserved || IsAvailableForItemLevelRequest($item, $patron, undef); + $can_item_be_reserved = $can_item_be_reserved || $patron && IsAvailableForItemLevelRequest( $item, $patron, undef ); } if( $can_item_be_reserved || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) { diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index c42d73abf0..9b85bbbe1e 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -140,7 +140,7 @@ my $can_item_be_reserved = 0; $items->reset; while ( my $item = $items->next ) { - $can_item_be_reserved = $can_item_be_reserved || IsAvailableForItemLevelRequest($item, $patron, undef); + $can_item_be_reserved = $can_item_be_reserved || $patron && IsAvailableForItemLevelRequest( $item, $patron, undef ); } if( $can_item_be_reserved || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) { -- 2.39.5