Bug 30525: Items batch modification broken
authorOwen Leonard <oleonard@myacpl.org>
Wed, 13 Apr 2022 14:07:53 +0000 (14:07 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Thu, 21 Apr 2022 23:41:36 +0000 (13:41 -1000)
This patch modifies instances in the code which try to get cookies
using:

my %cookies = parse CGI::Cookie($cookie);

In some cases the relevant lines can be removed because they are unused.
In others it can be replaced with:

my %cookies = CGI::Cookie->fetch();

To test, apply the patch and restart_all. Test the following pages to
confirm they load without errors:

- Circulation -> Offline circulation file upload
- Circulation -> Offline circulation -> Add to queue

- Tools -> Batch item modification
- Tools -> Stage MARC for import
- Tools -> Staged MARC management
- Tools -> Batch patron modification
- Tools -> Upload local cover image

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
offline_circ/enqueue_koc.pl
offline_circ/process_koc.pl
tools/batchMod.pl
tools/manage-marc-import.pl
tools/modborrowers.pl
tools/stage-marc-import.pl
tools/upload-cover-image.pl

index 1162d70..e10df95 100755 (executable)
@@ -46,10 +46,8 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user({
      flagsrequired   => { circulate => "circulate_remaining_permissions" },
 });
 
-
 my $fileID=$query->param('uploadedfileid');
-my %cookies = parse CGI::Cookie($cookie);
-my $sessionID = $cookies{'CGISESSID'}->value;
+
 ## 'Local' globals.
 our $dbh = C4::Context->dbh();
 
index 2ca6022..b3dc48a 100755 (executable)
@@ -56,7 +56,7 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user({
 my $fileID=$query->param('uploadedfileid');
 my $runinbackground = $query->param('runinbackground');
 my $completedJobID = $query->param('completedJobID');
-my %cookies = parse CGI::Cookie($cookie);
+my %cookies = CGI::Cookie->fetch();
 my $sessionID = $cookies{'CGISESSID'}->value;
 ## 'Local' globals.
 our $dbh = C4::Context->dbh();
index ef6dec1..e24db19 100755 (executable)
@@ -83,9 +83,6 @@ $restrictededition = 0 if ($restrictededition != 0 && C4::Context->IsSuperLibrar
 my $nextop="";
 my $display_items;
 
-my %cookies = parse CGI::Cookie($cookie);
-my $sessionID = $cookies{'CGISESSID'}->value;
-
 my @messages;
 
 if ( $op eq "action" ) {
index ef0bd36..87aae2a 100755 (executable)
@@ -54,7 +54,7 @@ my ($template, $loggedinuser, $cookie)
                  flagsrequired => {tools => 'manage_staged_marc'},
                  });
 
-my %cookies = parse CGI::Cookie($cookie);
+my %cookies = CGI::Cookie->fetch();
 our $sessionID = $cookies{'CGISESSID'}->value;
 our $dbh = C4::Context->dbh;
 
index 9b2a4e1..8aed3f4 100755 (executable)
@@ -51,8 +51,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 
 my $logged_in_user = Koha::Patrons->find( $loggedinuser );
 
-my %cookies   = parse CGI::Cookie($cookie);
-my $sessionID = $cookies{'CGISESSID'}->value;
 my $dbh       = C4::Context->dbh;
 
 # Show borrower informations
index 7653bc6..72ae9f7 100755 (executable)
@@ -79,7 +79,7 @@ $template->param(
     booksellerid => $booksellerid,
 );
 
-my %cookies = parse CGI::Cookie($cookie);
+my %cookies = CGI::Cookie->fetch();
 my $sessionID = $cookies{'CGISESSID'}->value;
 if ($completedJobID) {
     my $job = C4::BackgroundJob->fetch($sessionID, $completedJobID);
index cf82352..e533b83 100755 (executable)
@@ -70,8 +70,6 @@ my $itemnumber     = $input->param('itemnumber');
 my $replace        = !C4::Context->preference("AllowMultipleCovers")
   || $input->param('replace');
 my $op        = $input->param('op');
-my %cookies   = parse CGI::Cookie($cookie);
-my $sessionID = $cookies{'CGISESSID'}->value;
 
 my $error;