From 2de1433386cda07c8aa2186b2467a91fe48b4d14 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 4 Nov 2019 16:34:35 +0100 Subject: [PATCH] Bug 23414: Use effective_itemtype We should use effective_itemtype instead of itype to take the item-level_itypes pref into account. Note that we should not need to test for the existence of the key as we now assume that item types are correctly set to a valid item type. Signed-off-by: Liz Rea Signed-off-by: Jonathan Druart --- C4/XSLT.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 9ed7dc3b54..173d4e0da7 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -334,7 +334,10 @@ sub buildKohaItemsNamespace { elsif ($item->onloan) { $status = "Checked out"; } - elsif ( $item->notforloan && $item->notforloan > 0 || $item->itype && $itemtypes->{ $item->itype }->{notforloan} && $itemtypes->{ $item->itype }->{notforloan} == 1 ) { + elsif ( $item->notforloan && $item->notforloan > 0 + || exists $itemtypes->{ $item->effective_itemtype } + && $itemtypes->{ $item->effective_itemtype }->{notforloan} == 1 ) + { $status = "reference"; } elsif ( $item->notforloan < 0) { -- 2.11.0