From cdf987f0c6d8aff759aaa863e40cb2ba8049c9d5 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. --- 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.30.2