Bug 16259 - More: Replace CGI->param with CGI->multi_param in list context
Summary: More: Replace CGI->param with CGI->multi_param in list context
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 15809 16154
Blocks:
  Show dependency treegraph
 
Reported: 2016-04-14 12:06 UTC by Owen Leonard
Modified: 2016-12-05 21:25 UTC (History)
5 users (show)

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


Attachments
Bug 16259: Replace CGI->param with CGI->multi_param in list context - part 2 (8.26 KB, patch)
2016-04-15 08:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 16259: Replace CGI->param with CGI->multi_param in list context - part 2 (8.36 KB, patch)
2016-04-15 15:00 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 16259: Replace CGI->param with CGI->multi_param in list context - part 2 (8.33 KB, patch)
2016-04-29 12:45 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED QA] Bug 16259: Replace CGI->param with CGI->multi_param in list context - part 2 (8.39 KB, patch)
2016-05-08 11:18 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2016-04-14 12:06:39 UTC
In my testing of Bug 16154 I found some scripts which are still leaving errors in the log:

admin/branches.pl
admin/categories.pl
admin/patron-attr-types.pl
admin/preferences.pl
catalogue/itemsearch.pl
catalogue/image.pl
circ/circulation.pl
patroncards/add_user_search.pl
serials/add_user_search.pl
virtualshelves/shelves.pl


Copied from Bug 16154:

  my @foo = $cgi->param('foo');

must be replaced with

  my @foo = $cgi->multi_param('foo');

and

  $template->param( foo => $cgi->param('foo') );

must be replaced with

  $template->param( foo => scalar $cgi->param('foo') );
Comment 1 Jonathan Druart 2016-04-15 08:04:41 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2016-04-15 15:00:45 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2016-04-26 21:05:56 UTC
I've tried to apply this on top of 16154, but it no longer applies:

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 16259: Replace CGI->param with CGI->multi_param in list context - part 2
fatal: sha1 information is lacking or useless (admin/patron-attr-types.pl).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 Bug 16259: Replace CGI->param with CGI->multi_param in list context - part 2
Comment 4 Jonathan Druart 2016-04-29 12:45:50 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2016-05-08 11:18:48 UTC
Created attachment 51307 [details] [review]
[PASSED QA] Bug 16259: Replace CGI->param with CGI->multi_param in list context - part 2

This patch is a follow-up of bug 16154.

It removes the warning "CGI::param called in list context" in the
following scripts:
admin/branches.pl
admin/categories.pl
admin/patron-attr-types.pl
admin/preferences.pl
catalogue/image.pl
circ/circulation.pl
patroncards/add_user_search.pl
serials/add_user_search.pl
tools/marc_modification_templates.pl
virtualshelves/shelves.pl

Note that the warning from catalogue/itemsearch.pl still exists (the
call to CGI->param is done from the template).

Test plan:
- Add/modify a library, patron category, patron attr type
- Update a syspref
- Set localcoverimage and call catalogue/image.pl?biblionumber=XXX
- Search for patrons in the patron cards or serials module
- Add a marc modification templates
- Add a list (shelves)

You should not get the warning in the log after all these actions.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Kyle M Hall (khall) 2016-05-16 17:28:31 UTC
Pushed to master for 16.05, thanks Jonathan!
Comment 7 Julian Maurice 2016-05-17 05:45:18 UTC
Patch pushed to 3.22.x, will be in 3.22.7