[Bug 8880] New: Uninitialized variable triggers error log entry in circulation.pl
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8880 Priority: P5 - low Change sponsored?: --- Bug ID: 8880 CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Assignee: koha-bugs@lists.koha-community.org Summary: Uninitialized variable triggers error log entry in circulation.pl Severity: trivial Classification: Unclassified OS: All Reporter: mtompset@hotmail.com Hardware: All Status: NEW Version: unspecified Component: Circulation Product: Koha I am using bug 8777 as a master bug with several sub-bug reports, as various pieces may be accepted without issue, while others may need rebasing/refixing which would hinder one giant patch. This update overlaps with bug 8826, because the initialization of a hash is within three lines of part of this fix. As such, I have made the same changes in this patch. That is changed the initialization of the hashes from {} to (). To verify potential side effects, I did a search through the circulation.pl file for all occurrences of the variable initialized. This patch initializes $findborrower The error was triggered by trying to substitute on the very next line for an undefined findborrower. An if statement on $findborrow functions the same for undefined and q{}. And TT treats undefined as q{} as well. The || q{} should prevent the error and have no changes in logic. This patch initializes $barcode The error was triggered by trying to substitute on the very next line for an undefined barcode. The if condition on the following line behaves the same for undefined and q{}. The stickyduedate check if condition on $barcode behaves the same. The if condition to check "if we should print" now doesn't generate an error log entry. The inprocess initialization should not trigger an error log now. The next line's if still generates an error log due to a lack of the charges parameter, not due to an undefined barcode. The "STEP 3 : ISSUING" if condition behaves the same. There is no need to check inside the if, because q{} does not run that code (just like undefined didn't). And TT treats undefined as q{} as well. The || q{} should prevent errors and have no changes in logic. This patch initializes $print. Make sure not to confuse it with $printer. :) The "if we should print" if condition no longer generates an error log. However, the if condition containing "$borrowernumber ne ''" still generates an error log, as $borrowernumber is not initialized. Tracing the logic for $borrowernumber is more difficult as external functions are called using it. The || q{} for $print prevents an error and has no effect on the processing logic. Test Plan --------- 1) Login to staff client 2) Circulation 3) Click the 'Check out' link. 4) Go check the error log. Currently under 3.8.5 this generates error log entries for lines: 97,101,163,168,175,610,644, and 660 (in my testing on 3.8.5). 5) apply patch. 6) Home 7) Circulation 8) Click the 'Check out' link. 9) Go check the error log. This should resolve lines 97, 101, 163, and 175 (under 3.8.5) Patches to follow as master and 3.8.x differ. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8880 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |mtompset@hotmail.com |ity.org | --- Comment #1 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 12704 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12704&action=edit Added/Replaced with "|| q{}" into variable initialization This is the master version. Overlaps with bug 8826, so those changes are included in it. $findborrower, $barcode, $print variables are properly initialized reducing error log entries. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8880 --- Comment #2 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 12706 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12706&action=edit Added/Replaced with "|| q{}" into variable initialization This is the 3.8.x version. Overlaps with bug 8826, so those changes are included in it. $findborrower, $barcode, $print variables are properly initialized reducing error log entries. Similar bug exists in 3.6.x, but patch not generated, as neither the master nor 3.8.x versions apply due to the ongoing revisions to the section just above $findborrower's initialization. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8880 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8880 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #12704|0 |1 is obsolete| | --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 13358 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=13358&action=edit [SIGNED-OFF] Bug 8880 - Uninitialized variables trigger error log entries Simply by logging in, clicking Circulation, clicking the 'Check out' link, error log entries were generated. This patch ensures $findborrower, $barcode, and $print are all initialized by adding "|| q{}" onto their initializations. This reduces the silent error log entries generated. As this patch would overlap with bug 8826 in the initialization of hashes to prevent other error logs, those changes are in this patch. Applying this patch without having applied the patch for bug 8826. 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=8880 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #12706|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8880 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #12704|1 |0 is obsolete| | Attachment #12704|Added/Replaced with "|| |Added/Replaced with "|| description|q{}" into variable |q{}" into variable |initialization |initialization [3.8.x] -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8880 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #4 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This was signed off yesterday by Kyle M Hall. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8880 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #12704|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8880 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |jonathan.druart@biblibre.co | |m --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- QA Comments: Remove warning in log. Marked as Passed QA. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8880 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |jonathan.druart@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8880 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |jcamins@cpbibliography.com --- Comment #6 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This patch has been pushed to master. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8880 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.poulain@biblibre.com --- Comment #7 from Paul Poulain <paul.poulain@biblibre.com> --- Patch pushed to branch 3.10.x -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8880 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED CC| |chris@bigballofwax.co.nz Resolution|--- |FIXED --- Comment #8 from Chris Cormack <chris@bigballofwax.co.nz> --- Released in 3.10.0 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org