From 0df5bca8e5cde9f86899ccfce40b65fc2021e556 Mon Sep 17 00:00:00 2001 From: Shi Yao Wang Date: Thu, 5 May 2022 16:41:41 -0400 Subject: [PATCH] Bug 30697: Fix return value when $items_any_available is defined Return the value of $item_any_available when it is defined instead of the opposite value. --- C4/Reserves.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index d6121a7616..4b7ecffe1a 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -1352,8 +1352,7 @@ sub IsAvailableForItemLevelRequest { # if we have this param predefined from outer caller sub, we just need # to return it, so we saving from having loop inside other loop: - return $items_any_available ? 0 : 1 - if defined $items_any_available; + return $items_any_available if defined $items_any_available; my $any_available = ItemsAnyAvailableAndNotRestricted( { biblionumber => $item->biblionumber, patron => $patron }); return $any_available ? 0 : 1; -- 2.25.1