Bug 8176 - $sqlwhere is undefined in C4::Serials in GetSubscriptions
Summary: $sqlwhere is undefined in C4::Serials in GetSubscriptions
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: 3.8
Hardware: All All
: P5 - low normal (vote)
Target Milestone: ---
Assignee: Colin Campbell
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-01 04:12 UTC by M. Tompsett
Modified: 2013-12-05 19:59 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Proposed patch (895 bytes, patch)
2012-06-01 07:24 UTC, Colin Campbell
Details | Diff | Splinter Review
Bug 8176 [SIGNED-OFF] Assign an intial value to $sqlwhere (998 bytes, patch)
2012-06-01 09:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 8176 [SIGNED-OFF] Assign an intial value to $sqlwhere (5.33 KB, patch)
2012-06-09 10:28 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description M. Tompsett 2012-06-01 04:12:36 UTC
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.
Comment 1 Colin Campbell 2012-06-01 07:24:43 UTC Comment hidden (obsolete)
Comment 2 Colin Campbell 2012-06-01 07:28:11 UTC
Changed version to unspecified patch should apply to 3.6  and current development HEAD
Comment 3 Jonathan Druart 2012-06-01 09:32:57 UTC
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
Comment 4 Ian Walls 2012-06-04 15:25:23 UTC
Just gives $sqlwhere a default defined value of empty string.  Marking Passed QA.
Comment 5 Paul Poulain 2012-06-05 13:31:52 UTC
Colin, a question before pushing the patch : why =q{} and not ='' ?
Comment 6 Jonathan Druart 2012-06-05 14:18:25 UTC
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.)
Comment 7 Chris Cormack 2012-06-06 05:37:05 UTC
Pushed to 3.8.x, will be in 3.8.2
Comment 8 Kyle M Hall 2012-06-09 10:28:20 UTC Comment hidden (obsolete)