[Bug 8176] New: $sqlwhere is undefined in C4::Serials in GetSubscriptions
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8176 Priority: P5 - low Change sponsored?: --- Bug ID: 8176 Assignee: colin.campbell@ptfs-europe.com Summary: $sqlwhere is undefined in C4::Serials in GetSubscriptions Severity: normal Classification: Unclassified OS: All Reporter: mtompset@hotmail.com Hardware: All Status: NEW Version: rel_3_6 Component: Serials Product: Koha This is similar to 7105, but 7105 forgot to add one more line. Add this --> $sqlwhere = ( $sqlwhere ? $sqlwhere : "" ); Before this --> $sql .= "$sqlwhere ORDER BY title"; Around line 606 in C4::Serials. I'm looking at 3.6.3 This is what triggered my search: [Fri Jun 01 07:06:39 2012] [error] [client 192.168.100.2] [Fri Jun 1 07:06:39 2 012] serials-home.pl: Use of uninitialized value $sqlwhere in concatenation (.) or string at /usr/share/koha/lib/C4/Serials.pm line 606. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8176 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8176 --- Comment #1 from Colin Campbell <colin.campbell@ptfs-europe.com> --- Created attachment 9867 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=9867&action=edit Proposed patch Checking the variable with the ternary will generate a warning about comparison with an undefined var. (test needs to be defined $sqlwhere) The underlying problem is that we havent given an initial value to the var before either overwriting or concatening with it so this initializes it to an empty string, that done it should not log warnings -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8176 Colin Campbell <colin.campbell@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Version|rel_3_6 |unspecified --- Comment #2 from Colin Campbell <colin.campbell@ptfs-europe.com> --- Changed version to unspecified patch should apply to 3.6 and current development HEAD -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8176 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #9867|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 9872 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=9872&action=edit Bug 8176 [SIGNED-OFF] Assign an intial value to $sqlwhere warnings in log because of undefined value in string concatenation variable should be initialized to empty string rather than left undefined Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Removes a warning in logs -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8176 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |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=8176 Ian Walls <koha.sekjal@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |koha.sekjal@gmail.com --- Comment #4 from Ian Walls <koha.sekjal@gmail.com> --- Just gives $sqlwhere a default defined value of empty string. Marking Passed QA. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8176 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.poulain@biblibre.com --- Comment #5 from Paul Poulain <paul.poulain@biblibre.com> --- Colin, a question before pushing the patch : why =q{} and not ='' ? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8176 --- Comment #6 from Jonathan Druart <jonathan.druart@biblibre.com> --- Paul, q{} is preferable according to the PBP. http://cpan.uwinnipeg.ca/htdocs/Perl-Critic/Perl/Critic/Policy/ValuesAndExpr... and http://cheat.errtheblog.com/s/perl_best/1 #34 (Don’t use "" or '' for an empty string.) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8176 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master Version|unspecified |rel_3_8 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8176 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |chris@bigballofwax.co.nz --- Comment #7 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.8.x, will be in 3.8.2 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8176 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #9872|0 |1 is obsolete| | --- Comment #8 from Kyle M Hall <kyle.m.hall@gmail.com> --- Created attachment 10003 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10003&action=edit Bug 8176 [SIGNED-OFF] Assign an intial value to $sqlwhere warnings in log because of undefined value in string concatenation variable should be initialized to empty string rather than left undefined Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Removes a warning in logs Signed-off-by: Paul Poulain <paul.poulain@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8176 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10003|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=8176 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #9872|1 |0 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org