From 14c7dd10648b15349e809a297bb12c6ce4d04ac4 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Fri, 2 Jun 2017 08:42:32 +0000 Subject: [PATCH] Bug 18717: Check existence of variables Test plan: 0) Apply the patches from bug 8612 1) Have basket with some orders - at least one biblio should NOT have isbn filled 2) Define custom CSV profile of tpe SQL and Usage "Basket export in acquisition" 2) Go to basket detail and download basket as CSV using this custom CSV profile 3) Read the log --> without this patch you see the warning about uninitialized variables --> with patch the warning shouldn't be logged --- C4/Acquisition.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index ac5415b..98fdf6c 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -315,7 +315,10 @@ sub GetBasketAsCSV { my $bd = GetBiblioData( $order->{'biblionumber'} ); my @biblioitems = GetBiblioItemByBiblioNumber( $order->{'biblionumber'}); for my $biblioitem (@biblioitems) { - if ($biblioitem->{isbn} eq $order->{isbn}) { + if (defined $biblioitem->{isbn} + && defined $order->{isbn} + && $biblioitem->{isbn} eq $order->{isbn} + ) { $order = {%$order, %$biblioitem}; } } -- 2.1.4