From 4a84038a86a2b7c36f5d6dee7cdb0c4c31bee71d Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Sun, 10 Feb 2013 13:25:44 -0500 Subject: [PATCH] Bug 9574: Plack fixes for serials/subscription-add.pl This patch fixes the following warnings under Plack: * Use of uninitialized value $firstissuedate in string eq at \ /home/jcamins/kohaclone/serials/subscription-add.pl line 92. * Use of uninitialized value $firstissuedate in substr at \ /home/jcamins/kohaclone/serials/subscription-add.pl line 105. * Use of qw(...) as parentheses is deprecated at \ /home/jcamins/kohaclone/serials/subscription-add.pl line 95. * Variable "$firstissuedate" is not available at \ /home/jcamins/kohaclone/serials/subscription-add.pl line 338. To test: 1) Create a subscription. Ensure that setting the first issue's publication date works. 2) Edit a subscription. Ensure that the first issue's publication date shows up. 3) Sign off. Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer No regressions found, all tests and QA script pass. Signed-off-by: Jared Camins-Esakov --- serials/subscription-add.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl index ee1aea4570..10bccd187f 100755 --- a/serials/subscription-add.pl +++ b/serials/subscription-add.pl @@ -63,7 +63,7 @@ my @subscription_types = ( my @sub_type_data; my $subs; -my $firstissuedate; +our $firstissuedate; if ($op eq 'modify' || $op eq 'dup' || $op eq 'modsubscription') { @@ -74,7 +74,7 @@ if ($op eq 'modify' || $op eq 'dup' || $op eq 'modsubscription') { carp "Attempt to modify subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed"; print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); } - $firstissuedate = $subs->{firstacquidate}; # in iso format. + $firstissuedate = $subs->{firstacquidate} || ''; # in iso format. for (qw(startdate firstacquidate histstartdate enddate histenddate)) { next unless defined $subs->{$_}; # TODO : Handle date formats properly. @@ -92,7 +92,7 @@ if ($op eq 'modify' || $op eq 'dup' || $op eq 'modsubscription') { $nextexpected->{'isfirstissue'} = $nextexpected->{planneddate}->output('iso') eq $firstissuedate ; $subs->{nextacquidate} = $nextexpected->{planneddate}->output() if($op eq 'modify'); unless($op eq 'modsubscription') { - foreach my $length_unit qw(numberlength weeklength monthlength){ + foreach my $length_unit (qw(numberlength weeklength monthlength)) { if ($subs->{$length_unit}){ $sub_length=$subs->{$length_unit}; $sub_on=$length_unit; -- 2.39.5