Bug 30525 - Items batch modification broken
Summary: Items batch modification broken
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low critical
Assignee: Owen Leonard
QA Contact: Tomás Cohen Arazi (tcohen)
URL:
Keywords:
Depends on: 29957
Blocks:
  Show dependency treegraph
 
Reported: 2022-04-13 13:44 UTC by Fridolin Somers
Modified: 2022-12-12 21:24 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.05
Circulation function:


Attachments
Bug 30525: Items batch modification broken (4.51 KB, patch)
2022-04-13 15:54 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 30525: Items batch modification broken (4.57 KB, patch)
2022-04-19 17:41 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 30525: Items batch modification broken (4.64 KB, patch)
2022-04-21 16:56 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2022-04-13 13:44:34 UTC
Items batch modification is broken looks like it is since Bug 29957

I get the error :

Can't call method "value" on an undefined value at /kohadevbox/koha/tools/batchMod.pl line 87
       86: my %cookies = parse CGI::Cookie($cookie);
       87: my $sessionID = $cookies{'CGISESSID'}->value;
Comment 1 Fridolin Somers 2022-04-13 14:06:31 UTC
We see 2 ways :

 > git grep 'CGI::Cookie->fetch'
admin/import_export_authtype.pl:my %cookies = CGI::Cookie->fetch();
admin/import_export_framework.pl:my %cookies = CGI::Cookie->fetch();
authorities/merge_ajax.pl:my %cookies = CGI::Cookie->fetch;
cataloguing/merge_ajax.pl:my %cookies = CGI::Cookie->fetch;
opac/opac-ratings-ajax.pl:    my %cookies      = CGI::Cookie->fetch;
opac/opac-tags.pl:    my %cookies = CGI::Cookie->fetch;
tags/review.pl:    my %cookies = CGI::Cookie->fetch;
tools/background-job-progress.pl:my %cookies = CGI::Cookie->fetch;
tools/upload-file.pl:my %cookies = CGI::Cookie->fetch;
16:05:46 ~/git/koha-master [ master | v21.11.00 p+1076 | u= ]
 > git grep 'parse CGI::Cookie'
offline_circ/enqueue_koc.pl:my %cookies = parse CGI::Cookie($cookie);
offline_circ/process_koc.pl:my %cookies = parse CGI::Cookie($cookie);
tools/batchMod.pl:my %cookies = parse CGI::Cookie($cookie);
tools/manage-marc-import.pl:my %cookies = parse CGI::Cookie($cookie);
tools/modborrowers.pl:my %cookies   = parse CGI::Cookie($cookie);
tools/stage-marc-import.pl:my %cookies = parse CGI::Cookie($cookie);
tools/upload-cover-image.pl:my %cookies   = parse CGI::Cookie($cookie);
Comment 2 Owen Leonard 2022-04-13 15:54:56 UTC
Created attachment 133273 [details] [review]
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
Comment 3 Nick Clemens (kidclamp) 2022-04-19 17:41:49 UTC
Created attachment 133411 [details] [review]
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>
Comment 4 Tomás Cohen Arazi (tcohen) 2022-04-21 16:56:55 UTC
Created attachment 133594 [details] [review]
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>
Comment 5 Fridolin Somers 2022-04-21 23:42:19 UTC
Pushed to master for 22.05, thanks to everybody involved ﷐[U+1F984]﷑
Comment 6 Kyle M Hall (khall) 2022-04-22 18:29:54 UTC
Pushed to 21.11.x for 21.11.05
Comment 7 Andrew Fuerste-Henry 2022-05-03 19:42:29 UTC
Missing dependency, not backported to 21.05