From 01d5cfcf83457a3996e2e6eefc1055b5fac50412 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 13 Apr 2022 14:07:53 +0000 Subject: [PATCH] Bug 30525: Items batch modification broken 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 Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kyle M Hall --- offline_circ/enqueue_koc.pl | 4 +--- offline_circ/process_koc.pl | 2 +- tools/batchMod.pl | 3 --- tools/manage-marc-import.pl | 2 +- tools/modborrowers.pl | 2 -- tools/stage-marc-import.pl | 2 +- tools/upload-cover-image.pl | 2 -- 7 files changed, 4 insertions(+), 13 deletions(-) diff --git a/offline_circ/enqueue_koc.pl b/offline_circ/enqueue_koc.pl index 1162d70645..e10df9545d 100755 --- a/offline_circ/enqueue_koc.pl +++ b/offline_circ/enqueue_koc.pl @@ -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(); diff --git a/offline_circ/process_koc.pl b/offline_circ/process_koc.pl index 2ca602238e..b3dc48a54c 100755 --- a/offline_circ/process_koc.pl +++ b/offline_circ/process_koc.pl @@ -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(); diff --git a/tools/batchMod.pl b/tools/batchMod.pl index 81745c3e6f..9646020d6f 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -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" ) { diff --git a/tools/manage-marc-import.pl b/tools/manage-marc-import.pl index ef0bd36d33..87aae2afd9 100755 --- a/tools/manage-marc-import.pl +++ b/tools/manage-marc-import.pl @@ -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; diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl index d475f31331..ec23c32e4a 100755 --- a/tools/modborrowers.pl +++ b/tools/modborrowers.pl @@ -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 diff --git a/tools/stage-marc-import.pl b/tools/stage-marc-import.pl index 7653bc6893..72ae9f7c40 100755 --- a/tools/stage-marc-import.pl +++ b/tools/stage-marc-import.pl @@ -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); diff --git a/tools/upload-cover-image.pl b/tools/upload-cover-image.pl index f55d8f128d..3e48de1aa8 100755 --- a/tools/upload-cover-image.pl +++ b/tools/upload-cover-image.pl @@ -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; -- 2.39.5