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.
Created attachment 9867 [details] [review] 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
Changed version to unspecified patch should apply to 3.6 and current development HEAD
Created attachment 9872 [details] [review] 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
Just gives $sqlwhere a default defined value of empty string. Marking Passed QA.
Colin, a question before pushing the patch : why =q{} and not ='' ?
Paul, q{} is preferable according to the PBP. http://cpan.uwinnipeg.ca/htdocs/Perl-Critic/Perl/Critic/Policy/ValuesAndExpressions/ProhibitEmptyQuotes.pm.html and http://cheat.errtheblog.com/s/perl_best/1 #34 (Don’t use "" or '' for an empty string.)
Pushed to 3.8.x, will be in 3.8.2
Created attachment 10003 [details] [review] 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>