From 0cdcf7679984ac903794fe3f55add5c42ca71f59 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Fri, 5 Oct 2012 20:56:53 +0800 Subject: [PATCH] Bug 8880 - Uninitialized variables trigger error log entries Content-Type: text/plain; charset="utf-8" Simply by logging in, clicking Circulation, clicking the 'Check out' link, error log entries were generated. This patch ensures $findborrower, $barcode, and $print are all initialized by adding "|| q{}" onto their initializations. This reduces the silent error log entries generated. As this patch would overlap with bug 8826 in the initialization of hashes to prevent other error logs, those changes are in this patch. Applying this patch without having applied the patch for bug 8826. --- circ/circulation.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 7b388ce..46328b5 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -94,10 +94,10 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( my $branches = GetBranches(); my @failedrenews = $query->param('failedrenew'); # expected to be itemnumbers -our %renew_failed = {}; +our %renew_failed = (); for (@failedrenews) { $renew_failed{$_} = 1; } -my $findborrower = $query->param('findborrower'); +my $findborrower = $query->param('findborrower') || q{}; $findborrower =~ s|,| |g; my $borrowernumber = $query->param('borrowernumber'); @@ -118,7 +118,7 @@ if (C4::Context->preference("UseTablesortForCirc")) { $template->param(UseTablesortForCirc => 1); } -my $barcode = $query->param('barcode') || ''; +my $barcode = $query->param('barcode') || q{}; $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace $barcode = barcodedecode($barcode) if( $barcode && C4::Context->preference('itemBarcodeInputFilter')); @@ -127,7 +127,7 @@ my $duedatespec = $query->param('duedatespec') || $session->param('stickydu my $issueconfirmed = $query->param('issueconfirmed'); my $cancelreserve = $query->param('cancelreserve'); my $organisation = $query->param('organisations'); -my $print = $query->param('print'); +my $print = $query->param('print') || q{}; my $newexpiry = $query->param('dateexpiry'); my $debt_confirmed = $query->param('debt_confirmed') || 0; # Don't show the debt error dialog twice -- 1.7.9.5