From 86e4fe9c196385cb146afea174024acb40b6f284 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 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 Signed-off-by: Bouzid Fergani --- C4/Reserves.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index cf6ee50..372a246 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.7.4