Browse Source

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 <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
22.05.x
Owen Leonard 2 years ago
committed by Fridolin Somers
parent
commit
159a1a76c3
  1. 4
      offline_circ/enqueue_koc.pl
  2. 2
      offline_circ/process_koc.pl
  3. 3
      tools/batchMod.pl
  4. 2
      tools/manage-marc-import.pl
  5. 2
      tools/modborrowers.pl
  6. 2
      tools/stage-marc-import.pl
  7. 2
      tools/upload-cover-image.pl

4
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();

2
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();

3
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" ) {

2
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;

2
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

2
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);

2
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;

Loading…
Cancel
Save