From 56c121147d1040213724cae441b16af0dee60e47 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 20 Mar 2013 11:01:30 -0400 Subject: [PATCH] Bug 9873 - Quiet errors in the log from XSLT.pm Content-Type: text/plain; charset="utf-8" If XSLTResultsDisplay is enabled and items in your search results lack a shelving location or a ccode errors will appear in the log complaining of "uninitialized value in hash element." This patch adds a check on these values to quiet the errors. To test, find or create a record with items which have no shelving location and/or no collection code. Perform a search the results for which will include your record. Check for errors in the log. --- C4/XSLT.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 76a424b..6fd06af 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -279,8 +279,8 @@ sub buildKohaItemsNamespace { $status = "available"; } my $homebranch = $item->{homebranch}? xml_escape($branches->{$item->{homebranch}}->{'branchname'}):''; - $location = xml_escape($shelflocations->{$item->{location}}); - $ccode = xml_escape($ccodes->{$item->{ccode}}); + $location = $item->{location}? xml_escape($shelflocations->{$item->{location}}):''; + $ccode = $item->{ccode}? xml_escape($ccodes->{$item->{ccode}}):''; my $itemcallnumber = xml_escape($item->{itemcallnumber}); $xml.= "$homebranch". "$location". -- 1.7.9.5