From 07c19515fbed65b17d847ff6fd1abb02db8256c2 Mon Sep 17 00:00:00 2001 From: Shi Yao Wang Date: Fri, 29 Apr 2022 16:01:26 -0400 Subject: [PATCH] Bug 30556: Fix IsAvailableForItemLevelRequest to return early --- C4/Reserves.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 61c1e35cb6..af3145fbf1 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -1309,6 +1309,8 @@ sub IsAvailableForItemLevelRequest { # looped outside of IsAvailableForItemLevelRequest to avoid nested loops: my $items_any_available = shift; + return 0 unless $patron; + my $dbh = C4::Context->dbh; # must check the notforloan setting of the itemtype # FIXME - a lot of places in the code do this -- 2.25.1