[Bug 14185] New: Noisy warns in opac-readingrecord.pl
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14185 Bug ID: 14185 Summary: Noisy warns in opac-readingrecord.pl Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: trivial Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: aleishaamohia@hotmail.com QA Contact: testopia@bugs.koha-community.org If $limit is left undefined it causes a warn in error log -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14185 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14185 --- Comment #1 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Created attachment 39056 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39056&action=edit Bug 14185: Undefined $limit causes warn in opac/opac-readingrecord.pl This patch sets $limit to be an empty string. To test: 1) On the OPAC, click on your account in the top right (Welcome, 'yourname') 2) Go to 'your reading history' tab 3) Notice warns in error log 4) Apply patch 5) Reload page 6) Notice page still works but no warns -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14185 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|trivial |enhancement -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14185 Indranil Das Gupta <indradg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39056|0 |1 is obsolete| | --- Comment #2 from Indranil Das Gupta <indradg@gmail.com> --- Created attachment 39111 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39111&action=edit Bug 14185: Undefined $limit causes warn in opac/opac-readingrecord.pl This patch sets $limit to be an empty string. Test plan ========= 1/ login into the opac using your user account credentials 2/ in a terminal, run a `tail -f ` on your instance's opac-error.log 3/ go back to the opac, click on 'your reading history' tab to go to opac-readingrecord.pl 4/ notice the warning - "opac-readingrecord.pl: Use of uninitialized value $limit" appear in the `tail`ed opac-error.log 5/ apply the patch 6/ reload the page (opac-readingrecord.pl) 7/ page works but the warning in step #4 is no longer logged 8/ run qa test (i.e. koha-qa.pl -c 1 -v 2), there should be no error Remarks: Testing result match expected test plan output. The QA tests pass with "OK" for the commit. Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14185 Indranil Das Gupta <indradg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |indradg@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14185 --- Comment #3 from M. Tompsett <mtompset@hotmail.com> --- Comment on attachment 39111 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39111 Bug 14185: Undefined $limit causes warn in opac/opac-readingrecord.pl Review of attachment 39111: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=14185&attachment=39111) ----------------------------------------------------------------- ::: opac/opac-readingrecord.pl @@ +73,4 @@
my $limit = $query->param('limit'); +$limit //= '';
This works, but why not add "// ''" to line 75? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14185 --- Comment #4 from Aleisha Amohia <aleishaamohia@hotmail.com> --- (In reply to M. Tompsett from comment #3)
Comment on attachment 39111 [details] [review] Bug 14185: Undefined $limit causes warn in opac/opac-readingrecord.pl
Review of attachment 39111 [details] [review]: -----------------------------------------------------------------
::: opac/opac-readingrecord.pl @@ +73,4 @@
my $limit = $query->param('limit'); +$limit //= '';
This works, but why not add "// ''" to line 75?
I'm still very new to perl and had seen this warn solved this way before so just did it again. Of course if you think your way is cleaner then do that! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14185 Indranil Das Gupta <indradg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |aleishaamohia@hotmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14185 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com --- Comment #5 from M. Tompsett <mtompset@hotmail.com> --- (In reply to Aleisha Amohia from comment #4)
I'm still very new to perl and had seen this warn solved this way before so just did it again.
Ah, okay. :) I didn't know. When I started perl, I was unaware of //. The difference between || and // is an important distinction to know. :) undef || 'blah'; -- This is 'blah' 0 || 'blah'; -- This is 'blah' '' || 'blah'; -- This is 'blah' undef // 'blah'; -- This is 'blah' 0 // 'blah'; -- This is 0 '' // 'blah'; -- This is '' As you can see // depends on whether the value is actually defined, not just its truth value. So, you actually chose the better operator inadvertently. :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14185 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14185 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39111|0 |1 is obsolete| | --- Comment #6 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 39403 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39403&action=edit [PASSED QA] Bug 14185: Undefined $limit causes warn in opac/opac-readingrecord.pl This patch sets $limit to be an empty string. Test plan ========= 1/ login into the opac using your user account credentials 2/ in a terminal, run a `tail -f ` on your instance's opac-error.log 3/ go back to the opac, click on 'your reading history' tab to go to opac-readingrecord.pl 4/ notice the warning - "opac-readingrecord.pl: Use of uninitialized value $limit" appear in the `tail`ed opac-error.log 5/ apply the patch 6/ reload the page (opac-readingrecord.pl) 7/ page works but the warning in step #4 is no longer logged 8/ run qa test (i.e. koha-qa.pl -c 1 -v 2), there should be no error Remarks: Testing result match expected test plan output. The QA tests pass with "OK" for the commit. Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14185 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|Passed QA |Pushed to Master --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks Aleisha! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14185 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz Severity|enhancement |minor Status|Pushed to Master |Pushed to Stable --- Comment #8 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.20.x will be in 3.20.1 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14185 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wizzyrea@gmail.com --- Comment #9 from Liz Rea <wizzyrea@gmail.com> --- Patch pushed to 3.18.x will be in 3.18.08 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14185 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com --- Comment #10 from Mason James <mtj@kohaaloha.com> --- Pushed to 3.16.x, will be in 3.16.13 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org