From 833f38cde8f452e50a53ac84b70560069da2e79a Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Thu, 4 Mar 2021 17:27:16 +0100 Subject: [PATCH] Bug 27861: Warning in C4/XSLT.pm - use of uninitialized value in numeric eq (==) In C4/XSLT.pm : elsif ( exists $itemtypes->{ $item->effective_itemtype } && $itemtypes->{ $item->effective_itemtype }->{notforloan} == 1 ) itemtype.notforloan is null by default, its generated a warning in logs. Test plan : 1) Choose a record with itemtype.notforloan = NULL 2) Perform a search in the OPAC which will return results which include the record using XSLT 3) See patch removed warning Signed-off-by: Owen Leonard Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart (cherry picked from commit bda9b9e122df436d48e6416d140a7bbb45c8546c) Signed-off-by: Fridolin Somers (cherry picked from commit fa0af2da9f89fe4149336b76ec987713b41a1fc8) Signed-off-by: Andrew Fuerste-Henry --- C4/XSLT.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 1b3941c7fb..9c4e33e466 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -347,6 +347,7 @@ sub buildKohaItemsNamespace { $substatus = exists $descs{$item->notforloan} ? $descs{$item->notforloan}->{opac_description} : "Not for loan_".$item->notforloan; } elsif ( exists $itemtypes->{ $item->effective_itemtype } + && $itemtypes->{ $item->effective_itemtype }->{notforloan} && $itemtypes->{ $item->effective_itemtype }->{notforloan} == 1 ) { $status = "reference"; -- 2.39.5