Bug 20696

Summary: Remove a few ugly "eq undef" comparisons
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Architecture, internals, and plumbingAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, julian.maurice, martin.renvoize, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 20696: Fix a few ugly "eq undef" comparisons in Search.pm
Bug 20696: Fix a few ugly "eq undef" comparisons in Search.pm
Bug 20696: Fix a few ugly "eq undef" comparisons in Search.pm

Description Marcel de Rooy 2018-05-02 14:11:04 UTC
Title speaks for itself?
Comment 1 Marcel de Rooy 2018-05-02 14:19:20 UTC
Created attachment 74982 [details] [review]
Bug 20696: Fix a few ugly "eq undef" comparisons in Search.pm

Comparisons like $a eq undef should normally raise a warning like:
    Use of uninitialized value in string eq at ...
But unfortunately we still suppress warnings here and there.

Test plan:
[1] Just read this patch and confirm the small changes.
[2] Git grep on "eq undef" and do not find other occurrences.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Owen Leonard 2018-05-10 14:43:26 UTC
Created attachment 75224 [details] [review]
Bug 20696: Fix a few ugly "eq undef" comparisons in Search.pm

Comparisons like $a eq undef should normally raise a warning like:
    Use of uninitialized value in string eq at ...
But unfortunately we still suppress warnings here and there.

Test plan:
[1] Just read this patch and confirm the small changes.
[2] Git grep on "eq undef" and do not find other occurrences.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Passes test plan and QA tools. Searching works correctly.
Comment 3 Julian Maurice 2018-05-18 07:38:52 UTC
Created attachment 75402 [details] [review]
Bug 20696: Fix a few ugly "eq undef" comparisons in Search.pm

Comparisons like $a eq undef should normally raise a warning like:
    Use of uninitialized value in string eq at ...
But unfortunately we still suppress warnings here and there.

Test plan:
[1] Just read this patch and confirm the small changes.
[2] Git grep on "eq undef" and do not find other occurrences.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Passes test plan and QA tools. Searching works correctly.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 4 Nick Clemens (kidclamp) 2018-05-29 14:43:35 UTC
Pushed to master for 18.11.

Awesome work all, thank you.
Comment 5 Martin Renvoize 2018-06-05 10:43:42 UTC
This patch has been pushed to 18.05.x and will be in 18.05.01
Comment 6 Fridolin Somers 2018-06-07 07:02:33 UTC
Pushed to 17.11.x for 17.11.07.

Ugly indeed ;)