Bug 16259

Summary: More: Replace CGI->param with CGI->multi_param in list context
Product: Koha Reporter: Owen Leonard <oleonard>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: hblancoca, jonathan.druart, julian.maurice, kyle, testopia
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16476
Change sponsored?: --- Patch complexity: Medium patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 15809, 16154    
Bug Blocks:    
Attachments: Bug 16259: Replace CGI->param with CGI->multi_param in list context - part 2
[SIGNED-OFF] Bug 16259: Replace CGI->param with CGI->multi_param in list context - part 2
Bug 16259: Replace CGI->param with CGI->multi_param in list context - part 2
[PASSED QA] Bug 16259: Replace CGI->param with CGI->multi_param in list context - part 2

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