[Bug 29771] New: Get rid of CGI::param in list context warnings
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Bug ID: 29771 Summary: Get rid of CGI::param in list context warnings Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Get rid of CGI::param in |Get rid of CGI::param in |list context warnings |list context warnings | |[UMBRELLA] Depends on| |29758 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29758 [Bug 29758] CGI::param in list context in boraccount.pl warning -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |21051, 18320, 17239 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17239 [Bug 17239] Vulnerabilitiy warning for package C4::Biblio https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18320 [Bug 18320] patroncards/edit-layout.pl raises warnings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21051 [Bug 21051] CGI::param called in list context when editing a patron card layout -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- $ git grep '\->param' | grep -v -e 'template' -e 'multi_param' | grep '@' | wc -l 54 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 128908 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128908&action=edit Bug 29771: Remove warning from acqui/finishreceive.pl This patch removes a warning that shows when receiving. To test: 1. Do the acq workflow up to the receive step. 2. Once you choose the items and click on Finish => FAIL: There's a warning in the logs 3. Revert receipt 4. Apply this patch 5. Receive => SUCCESS: No more warnings 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Small patch CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #128908|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |evelyn@bywatersolutions.com | |, liz@bywatersolutions.com Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 128909 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128909&action=edit Bug 29771: Remove trivial cases I squashed the patches because they are too trivial to have a test plan. Or it is too much work to write the test plan for such trivial cases. I leave the original commit messages just in case. Generally, this are all cases in which CGI::param is being called in a trivially identifiable _list context_. i.e. they are assigned to a @variable. I left one case out on purpose: admin/auth_subfields_structure.pl Paul introduced this: my @kohafield = ''.$input->param('kohafield'); and then: my $kohafield = $kohafield[$i]; My intuition says it is forcing scalar context on the first assignment so the list contains a single element and then inside the loop some $kohafield assignments should lead to undef, and even warnings. I leave it for a separate patch because it is not that easy testable and is a sensible area. Bug 29771: Remove warning from acqui/finishreceive.pl This patch removes a warning that shows when receiving. To test: 1. Do the acq workflow up to the receive step. 2. Once you choose the items and click on Finish => FAIL: There's a warning in the logs 3. Revert receipt 4. Apply this patch 5. Receive => SUCCESS: No more warnings 6. Sign off :-D Bug 29771: Remove warning from svc/members/add_to_list To test: 1. Run: $ tail -f /var/log/koha/kohadev/*-error.log 2. Generate a patron list 3. Perform a patron search that gives you a few 4. Select some, and choose to add them to the list => FAIL: The logs show the infamous warn: CGI::param called in list context from /kohadevbox/koha/svc/members/add_to_list 5. Apply this patch 6. Restart plack and repeat 4 => SUCCESS: No warn! 7. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 128910 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128910&action=edit Bug 29771: Scalar context for split This patch tackles a very specific scenario. Calling split(..., CGI::param) makes it be called in list context. The split docs say: split /PATTERN/,EXPR,LIMIT this means the first CGI param will be used as EXPR and the second one as LIMIT, which is wrong anyway. So the fix is to just force scalar context. To test: 1. Not sure, just make sure nothing breaks when using the scripts in the browser. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Get rid of CGI::param in |Get rid of CGI::param in |list context warnings |list context warnings |[UMBRELLA] | Blocks| |25790 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25790 [Bug 25790] [OMNIBUS] warnings removal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Bug 29771 depends on bug 21051, which changed state. Bug 21051 Summary: CGI::param called in list context when editing a patron card layout https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21051 What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |DUPLICATE -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |jonathan.druart+koha@gmail. |y.org |com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Bug 29771 depends on bug 29758, which changed state. Bug 29758 Summary: CGI::param in list context in boraccount.pl warning https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29758 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Bug 29771 depends on bug 18320, which changed state. Bug 18320 Summary: patroncards/edit-layout.pl raises warnings https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18320 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #128909|0 |1 is obsolete| | --- Comment #5 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 131129 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131129&action=edit Bug 29771: Remove trivial cases I squashed the patches because they are too trivial to have a test plan. Or it is too much work to write the test plan for such trivial cases. I leave the original commit messages just in case. Generally, this are all cases in which CGI::param is being called in a trivially identifiable _list context_. i.e. they are assigned to a @variable. I left one case out on purpose: admin/auth_subfields_structure.pl Paul introduced this: my @kohafield = ''.$input->param('kohafield'); and then: my $kohafield = $kohafield[$i]; My intuition says it is forcing scalar context on the first assignment so the list contains a single element and then inside the loop some $kohafield assignments should lead to undef, and even warnings. I leave it for a separate patch because it is not that easy testable and is a sensible area. Bug 29771: Remove warning from acqui/finishreceive.pl This patch removes a warning that shows when receiving. To test: 1. Do the acq workflow up to the receive step. 2. Once you choose the items and click on Finish => FAIL: There's a warning in the logs 3. Revert receipt 4. Apply this patch 5. Receive => SUCCESS: No more warnings 6. Sign off :-D Bug 29771: Remove warning from svc/members/add_to_list To test: 1. Run: $ tail -f /var/log/koha/kohadev/*-error.log 2. Generate a patron list 3. Perform a patron search that gives you a few 4. Select some, and choose to add them to the list => FAIL: The logs show the infamous warn: CGI::param called in list context from /kohadevbox/koha/svc/members/add_to_list 5. Apply this patch 6. Restart plack and repeat 4 => SUCCESS: No warn! 7. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #128910|0 |1 is obsolete| | --- Comment #6 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 131130 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131130&action=edit Bug 29771: Scalar context for split This patch tackles a very specific scenario. Calling split(..., CGI::param) makes it be called in list context. The split docs say: split /PATTERN/,EXPR,LIMIT this means the first CGI param will be used as EXPR and the second one as LIMIT, which is wrong anyway. So the fix is to just force scalar context. To test: 1. Not sure, just make sure nothing breaks when using the scripts in the browser. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #131129|0 |1 is obsolete| | --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 131187 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131187&action=edit Bug 29771: Remove trivial cases I squashed the patches because they are too trivial to have a test plan. Or it is too much work to write the test plan for such trivial cases. I leave the original commit messages just in case. Generally, this are all cases in which CGI::param is being called in a trivially identifiable _list context_. i.e. they are assigned to a @variable. I left one case out on purpose: admin/auth_subfields_structure.pl Paul introduced this: my @kohafield = ''.$input->param('kohafield'); and then: my $kohafield = $kohafield[$i]; My intuition says it is forcing scalar context on the first assignment so the list contains a single element and then inside the loop some $kohafield assignments should lead to undef, and even warnings. I leave it for a separate patch because it is not that easy testable and is a sensible area. Bug 29771: Remove warning from acqui/finishreceive.pl This patch removes a warning that shows when receiving. To test: 1. Do the acq workflow up to the receive step. 2. Once you choose the items and click on Finish => FAIL: There's a warning in the logs 3. Revert receipt 4. Apply this patch 5. Receive => SUCCESS: No more warnings 6. Sign off :-D Bug 29771: Remove warning from svc/members/add_to_list To test: 1. Run: $ tail -f /var/log/koha/kohadev/*-error.log 2. Generate a patron list 3. Perform a patron search that gives you a few 4. Select some, and choose to add them to the list => FAIL: The logs show the infamous warn: CGI::param called in list context from /kohadevbox/koha/svc/members/add_to_list 5. Apply this patch 6. Restart plack and repeat 4 => SUCCESS: No warn! 7. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #131130|0 |1 is obsolete| | --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 131188 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131188&action=edit Bug 29771: Scalar context for split This patch tackles a very specific scenario. Calling split(..., CGI::param) makes it be called in list context. The split docs say: split /PATTERN/,EXPR,LIMIT this means the first CGI param will be used as EXPR and the second one as LIMIT, which is wrong anyway. So the fix is to just force scalar context. To test: 1. Not sure, just make sure nothing breaks when using the scripts in the browser. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |martin.renvoize@ptfs-europe | |.com --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Great call! This fixes all obvious cases and many non-obvious ones too.. No regressions found, lets get this pushed and deal with any further occurrences as we spot them. It would be nice to have a QA script test catch new introductions of such warnings.. but that can be handled outside of this bug. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #10 from Fridolin Somers <fridolin.somers@biblibre.com> --- Dependency with Bug 17239 ? isn't it the opposite relation ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Fridolin Somers from comment #10)
Dependency with Bug 17239 ? isn't it the opposite relation ?
I think it is wrong. Probably a duplicate instead -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 --- Comment #12 from Fridolin Somers <fridolin.somers@biblibre.com> --- (In reply to Tomás Cohen Arazi from comment #11)
(In reply to Fridolin Somers from comment #10)
Dependency with Bug 17239 ? isn't it the opposite relation ?
I think it is wrong. Probably a duplicate instead
OK I move to See Also -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|17239 | See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=17239 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17239 [Bug 17239] Vulnerabilitiy warning for package C4::Biblio -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 --- Comment #13 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to master for 22.05, thanks to everybody involved 🦄 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |kyle@bywatersolutions.com Version(s)|22.05.00 |22.05.00,21.11.04 released in| | --- Comment #14 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 21.11.x for 21.11.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com Version(s)|22.05.00,21.11.04 |22.05.00,21.11.04,21.05.14 released in| | Status|Pushed to stable |Pushed to oldstable --- Comment #15 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Pushed to 21.05.x for 21.05.14 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |victor@tuxayo.net Status|Pushed to oldstable |RESOLVED --- Comment #16 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|25790 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25790 [Bug 25790] [OMNIBUS] warnings removal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29771 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |25790 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25790 [Bug 25790] [OMNIBUS] warnings removal -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org