Skip to content

Commit

Permalink
Bug 30525: Items batch modification broken
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
oleonard authored and fridobox committed Apr 21, 2022
1 parent 674ad80 commit 159a1a7
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 13 deletions.
4 changes: 1 addition & 3 deletions offline_circ/enqueue_koc.pl
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@
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();

Expand Down
2 changes: 1 addition & 1 deletion offline_circ/process_koc.pl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
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();
Expand Down
3 changes: 0 additions & 3 deletions tools/batchMod.pl
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@
my $nextop="";
my $display_items;

my %cookies = parse CGI::Cookie($cookie);
my $sessionID = $cookies{'CGISESSID'}->value;

my @messages;

if ( $op eq "action" ) {
Expand Down
2 changes: 1 addition & 1 deletion tools/manage-marc-import.pl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
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;

Expand Down
2 changes: 0 additions & 2 deletions tools/modborrowers.pl
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@

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
Expand Down
2 changes: 1 addition & 1 deletion tools/stage-marc-import.pl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
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);
Expand Down
2 changes: 0 additions & 2 deletions tools/upload-cover-image.pl
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ =head1 DESCRIPTION
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;

Expand Down

0 comments on commit 159a1a7

Please sign in to comment.