Summary: | $sqlwhere is undefined in C4::Serials in GetSubscriptions | ||
---|---|---|---|
Product: | Koha | Reporter: | Mark Tompsett <mtompset> |
Component: | Serials | Assignee: | Colin Campbell <colin.campbell> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | chris, jonathan.druart, koha.sekjal, mtompset, paul.poulain |
Version: | 3.8 | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Proposed patch
Bug 8176 [SIGNED-OFF] Assign an intial value to $sqlwhere Bug 8176 [SIGNED-OFF] Assign an intial value to $sqlwhere |
Description
Mark Tompsett
2012-06-01 04:12:36 UTC
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> |