[Koha-patches] [PATCH] Bug 10728 Dont issue warning because mode is not defined

Colin Campbell colin.campbell at ptfs-europe.com
Wed Aug 14 16:54:23 CEST 2013


error log is showing warnings because mode is undefined
and we are doing string comparisons on it
Set it to a default value ( we were already assigning it a variable
which we were not using ) and use the the result in the comparison
---
 serials/subscription-renew.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/serials/subscription-renew.pl b/serials/subscription-renew.pl
index 48861bc..47b35f0 100755
--- a/serials/subscription-renew.pl
+++ b/serials/subscription-renew.pl
@@ -59,7 +59,7 @@ use C4::Serials;
 my $query = new CGI;
 my $dbh   = C4::Context->dbh;
 
-my $mode           = $query->param('mode');
+my $mode           = $query->param('mode') || q{};
 my $op             = $query->param('op') || q{};
 my $subscriptionid = $query->param('subscriptionid');
 my $done = 0;    # for after form has been submitted
@@ -99,7 +99,7 @@ $template->param(
     subscriptionid => $subscriptionid,
     bibliotitle    => $subscription->{bibliotitle},
     $op            => 1,
-    popup          => ($query->param('mode')eq "popup"),
+    popup          => ($mode eq 'popup'),
 );
 
 # Print the page
-- 
1.8.4.rc2.15.g96cb27a



More information about the Koha-patches mailing list