From 71d104d20b18d31e11934129778c1f67571a8b1a Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Wed, 21 Mar 2012 11:28:54 +0100 Subject: [PATCH] Bug 7773 - serials/subscription-add.pl scope for plack This fixes scope of $query and $nextexpected Signed-off-by: Alex Arnaud Signed-off-by: Paul Poulain --- 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 9acee7b56b..4038e1a2cf 100755 --- a/serials/subscription-add.pl +++ b/serials/subscription-add.pl @@ -34,7 +34,7 @@ use Carp; #use Smart::Comments; -my $query = CGI->new; +our $query = CGI->new; my $op = $query->param('op') || ''; my $dbh = C4::Context->dbh; my $sub_length; @@ -64,7 +64,6 @@ my @sub_type_data; my $subs; my $firstissuedate; -my $nextexpected; if ($op eq 'modify' || $op eq 'dup' || $op eq 'modsubscription') { @@ -89,7 +88,7 @@ if ($op eq 'modify' || $op eq 'dup' || $op eq 'modsubscription') { $subs->{letter}= q{}; } letter_loop($subs->{'letter'}, $template); - $nextexpected = GetNextExpected($subscriptionid); + my $nextexpected = GetNextExpected($subscriptionid); $nextexpected->{'isfirstissue'} = $nextexpected->{planneddate}->output('iso') eq $firstissuedate ; $subs->{nextacquidate} = $nextexpected->{planneddate}->output() if($op eq 'modify'); unless($op eq 'modsubscription') { @@ -326,6 +325,7 @@ sub redirect_mod_subscription { my $opacdisplaycount = $query->param('opacdisplaycount'); my $graceperiod = $query->param('graceperiod') || 0; my $location = $query->param('location'); + my $nextexpected = GetNextExpected($subscriptionid); # If it's a mod, we need to check the current 'expected' issue, and mod it in the serials table if necessary. if ( $nextacquidate ne $nextexpected->{planneddate}->output('iso') ) { ModNextExpected($subscriptionid,C4::Dates->new($nextacquidate,'iso')); -- 2.39.5