From 9c4b1d93331488956fc69aaf5cbc5e5a1579f403 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 8 Nov 2019 09:16:53 +0000 Subject: [PATCH] Bug 23993: Add check if itemtype exists in IsAvailableForItemLevelRequest Content-Type: text/plain; charset=utf-8 Trivial change Test plan: Run Reserves.t Import book with unknown item type, try to place hold (with/without patch) Signed-off-by: Marcel de Rooy --- C4/Reserves.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index cf6ee50169..372a246004 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -1174,7 +1174,10 @@ sub IsAvailableForItemLevelRequest { # or something similar - need to be # consolidated my $itemtype = $item->effective_itemtype; - my $notforloan_per_itemtype = Koha::ItemTypes->find($itemtype)->notforloan; + my $itemtypeobj = Koha::ItemTypes->find($itemtype); + my $notforloan_per_itemtype = $itemtypeobj + ? $itemtypeobj->notforloan + : 1; # itype undefined: not for loan return 0 if $notforloan_per_itemtype || -- 2.11.0