Bug 7851 - circ/circulation.pl plack scoping
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 30 Mar 2012 16:58:53 +0000 (18:58 +0200)
committerPaul Poulain <paul.poulain@biblibre.com>
Tue, 3 Apr 2012 16:14:19 +0000 (18:14 +0200)
Errors:

Variable "$totalprice" is not available at /srv/koha/circ/circulation.pl line 448.
Variable "%renew_failed" is not available at /srv/koha/circ/circulation.pl line 456.
Variable "$todaysdate" is not available at /srv/koha/circ/circulation.pl line 458.
Variable "@todaysissues" is not available at /srv/koha/circ/circulation.pl line 459.
Variable "@relissues" is not available at /srv/koha/circ/circulation.pl line 459.
Variable "@previousissues" is not available at /srv/koha/circ/circulation.pl line 461.
Variable "@relprevissues" is not available at /srv/koha/circ/circulation.pl line 461.

Test scenario:
1. go to circulation page
2. verify errors in console output of plack
3. apply patch
4. reload and verify that errors are gone

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
circ/circulation.pl

index 469209c..2c93547 100755 (executable)
@@ -93,7 +93,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
 my $branches = GetBranches();
 
 my @failedrenews = $query->param('failedrenew');    # expected to be itemnumbers 
-my %renew_failed;
+our %renew_failed;
 for (@failedrenews) { $renew_failed{$_} = 1; }
 
 my $findborrower = $query->param('findborrower');
@@ -156,7 +156,7 @@ if($duedatespec_allow){
     }
 }
 
-my $todaysdate = C4::Dates->new->output('iso');
+our $todaysdate = C4::Dates->new->output('iso');
 
 # check and see if we should print
 if ( $barcode eq '' && $print eq 'maybe' ) {
@@ -413,13 +413,13 @@ if ($borrowernumber) {
 # make the issued books table.
 my $todaysissues = '';
 my $previssues   = '';
-my @todaysissues;
-my @previousissues;
-my @relissues;
-my @relprevissues;
+our @todaysissues;
+our @previousissues;
+our @relissues;
+our @relprevissues;
 my $displayrelissues;
 
-my $totalprice = 0;
+our $totalprice = 0;
 
 sub build_issue_data {
     my $issueslist = shift;