From 4fa669c602b19408068ab544f9983f68ea292cd5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 11 May 2016 15:05:59 +0100 Subject: [PATCH] Bug 16499: Remove "Use of uninitialized value" warnings in circulation.pl If you search for a patron in the circulation module, you get: Use of uninitialized value $barcode in string eq at /home/koha/src/circ/circulation.pl line 84. Use of uninitialized value $restoreduedatespec in string eq at /home/koha/src/circ/circulation.pl line 170. Test plan: - Search for a patron and confirm the warnings are not displayed anymore - Make sure this patch does not introduce regression on bug 14015 --- circ/circulation.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index e31c7c5..8dcebe5 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -81,7 +81,7 @@ if (!C4::Context->userenv){ my $barcodes = []; my $barcode = $query->param('barcode'); # Barcode given by user could be '0' -if ( $barcode || $barcode eq '0' ) { +if ( $barcode or defined $barcode and $barcode eq '0' ) { $barcodes = [ $barcode ]; } else { my $filefh = $query->upload('uploadfile'); @@ -167,7 +167,7 @@ my $duedatespec = $query->param('duedatespec') || $session->param('stickydu $duedatespec = eval { output_pref( { dt => dt_from_string( $duedatespec ), dateformat => 'iso' }); } if ( $duedatespec ); my $restoreduedatespec = $query->param('restoreduedatespec') || $session->param('stickyduedate') || $duedatespec; -if ($restoreduedatespec eq "highholds_empty") { +if ($restoreduedatespec and $restoreduedatespec eq "highholds_empty") { undef $restoreduedatespec; } my $issueconfirmed = $query->param('issueconfirmed'); -- 2.7.0