[Bug 28483] New: Warnings from Search.t must be removed
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28483 Bug ID: 28483 Summary: Warnings from Search.t must be removed Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: jonathan.druart+koha@gmail.com QA Contact: testopia@bugs.koha-community.org Depends on: 21260 Blocks: 25515 The syspref Reference_NFL_Statuses was requested but I don't know what to say; this indicates that the test requires updating at t/db_dependent/Search.t line 197. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21260 [Bug 21260] Improve the Availability line of OPAC XSLT search results https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25515 [Bug 25515] Remove warnings and errors from tests output -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28483 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28483 --- Comment #1 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 122312 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122312&action=edit Bug 28483: Avoid useless warnings There are too many warnings about uninitialized variables in Search.pm. This patch deals with that, the same way it is dealt accross the file: by setting an empty string when things are not defined. To test: 1. Run: $ kshell k$ prove t/db_dependent/Search.t => FAIL: Wow, too many warnings. Some related to this bug, some not. 2. Apply this patch 3. Repeat 1 => SUCCESS: No more warnings! 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28483 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chris@bigballofwax.co.nz |tomascohen@gmail.com Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28483 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #122312|0 |1 is obsolete| | --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 122313 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122313&action=edit Bug 28483: Remove warnings from Search.t There are too many warnings about uninitialized variables in Search.pm. This patch deals with that, the same way it is dealt accross the file: by setting an empty string when things are not defined. To test: 1. Run: $ kshell k$ prove t/db_dependent/Search.t => FAIL: Wow, too many warnings. Some related to this bug, some not. 2. Apply this patch 3. Repeat 1 => SUCCESS: No more warnings! 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28483 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- When seeing this, I wonder right away why not the other one? - my $query = $operands[0]; + my $query = $operands[0] // ""; my $simple_query = $operands[0]; And looking a bit later, I see: for ($query_cgi,$simple_query) { s/"//g; } Shouldnt this trigger a warn too when undefined? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28483 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28483 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #122313|0 |1 is obsolete| | --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 122740 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122740&action=edit Bug 28483: Remove warnings from Search.t There are too many warnings about uninitialized variables in Search.pm. This patch deals with that, the same way it is dealt accross the file: by setting an empty string when things are not defined. To test: 1. Run: $ kshell k$ prove t/db_dependent/Search.t => FAIL: Wow, too many warnings. Some related to this bug, some not. 2. Apply this patch 3. Repeat 1 => SUCCESS: No more warnings! 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28483 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com QA Contact|testopia@bugs.koha-communit |nick@bywatersolutions.com |y.org | --- Comment #5 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Marcel de Rooy from comment #3)
When seeing this, I wonder right away why not the other one?
- my $query = $operands[0]; + my $query = $operands[0] // ""; my $simple_query = $operands[0];
And looking a bit later, I see: for ($query_cgi,$simple_query) { s/"//g; } Shouldnt this trigger a warn too when undefined?
The code sets it undef later, and simple_query is not used between the two places -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28483 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Nick Clemens from comment #5)
(In reply to Marcel de Rooy from comment #3)
When seeing this, I wonder right away why not the other one?
- my $query = $operands[0]; + my $query = $operands[0] // ""; my $simple_query = $operands[0];
And looking a bit later, I see: for ($query_cgi,$simple_query) { s/"//g; } Shouldnt this trigger a warn too when undefined?
The code sets it undef later, and simple_query is not used between the two places
Hmm. Not important but I do not see that it is set to undef later, and if it is, then it will surely trigger the uninitialized warn that we want to resolve. If it is not set, then it depends on $operands[0] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28483 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28483 --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28483 --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 122794 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122794&action=edit Bug 28483: Fix t/Search/buildQuery.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28483 --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Follow-up pushed to master. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28483 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.11.00 |21.11.00,21.05.02 released in| | Status|Pushed to master |Pushed to stable CC| |kyle@bywatersolutions.com --- Comment #10 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 21.05.x for 21.05.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28483 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Status|Pushed to stable |RESOLVED Resolution|--- |FIXED --- Comment #11 from Fridolin Somers <fridolin.somers@biblibre.com> --- Depends on Bug 21260 not in 20.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28483 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|25515 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25515 [Bug 25515] [OMNIBUS] Remove warnings and errors from tests output -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28483 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |40444 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40444 [Bug 40444] Add a test to ensure all Perl test files use Test::NoWarnings -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org