Bug 17736: [QA Follow-up] Script basket.pl is not Plack compliant
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 6 Jan 2017 12:36:35 +0000 (13:36 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 31 Mar 2017 12:04:17 +0000 (12:04 +0000)
Several warnings like:
Variable "$confirm_pref" is not available at /usr/share/koha/masterclone/acqui/basket.pl line 507.

Primarily caused by sub edi_close_and_order.

Easy fix.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
acqui/basket.pl

index 0677e33..e556be2 100755 (executable)
@@ -69,13 +69,13 @@ the supplier this script have to display the basket.
 
 =cut
 
-my $query        = new CGI;
+our $query        = new CGI;
 our $basketno     = $query->param('basketno');
-my $ean          = $query->param('ean');
-my $booksellerid = $query->param('booksellerid');
+our $ean          = $query->param('ean');
+our $booksellerid = $query->param('booksellerid');
 my $duplinbatch =  $query->param('duplinbatch');
 
-my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
+our ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
     {
         template_name   => "acqui/basket.tt",
         query           => $query,
@@ -86,7 +86,7 @@ my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
     }
 );
 
-my $basket = GetBasket($basketno);
+our $basket = GetBasket($basketno);
 $booksellerid = $basket->{booksellerid} unless $booksellerid;
 my $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid );
 my $schema = Koha::Database->new()->schema();
@@ -112,7 +112,7 @@ unless (CanUserManageBasket($loggedinuser, $basket, $userflags)) {
 # warn "=>".$basket->{booksellerid};
 my $op = $query->param('op') // 'list';
 
-my $confirm_pref= C4::Context->preference("BasketConfirmations") || '1';
+our $confirm_pref= C4::Context->preference("BasketConfirmations") || '1';
 $template->param( skip_confirm_reopen => 1) if $confirm_pref eq '2';
 
 my @messages;