Bug 14344

Summary: uninitialized value warning C4/Utils/DataTables/Members.pm
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: chris, mtj, tomascohen, wizzyrea
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14436
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 14344: uninitialized value warning C4/Utils/DataTables/Members.pm
Bug 14344: uninitialized value warning C4/Utils/DataTables/Members.pm
[PASSED QA] Bug 14344: uninitialized value warning C4/Utils/DataTables/Members.pm

Description Tomás Cohen Arazi 2015-06-05 14:56:07 UTC
On a clean dev install in master, if you search for a user, say 'acevedo' you will get a warning in the logs:

[Fri Jun 05 11:25:01.173014 2015] [cgi:error] [pid 13536] [client 127.0.0.1:51033] AH01215: [Fri Jun  5 11:25:01 2015] circulation.pl: Use of uninitialized value $searchtype in string eq at /home/tcohen/git/koha-community-src/C4/Utils/DataTables/Members.pm line 78., referer: http://koha-dev.biblioadmin/cgi-bin/koha/mainpage.pl
Comment 1 Tomás Cohen Arazi 2015-06-05 15:09:10 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2015-06-05 16:48:12 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2015-06-06 14:14:41 UTC
Created attachment 39937 [details] [review]
[PASSED QA] Bug 14344: uninitialized value warning C4/Utils/DataTables/Members.pm

The condition for the assignment depends on $searchtype to be defined
and equal to 'contains'. So this change doesn't change the semantics.

-            if $term !~ /^%/
-                and $searchtype eq "contain";
+            if (defined $searchtype) && $searchtype eq "contain"
+                && $term !~ /^%/;

To test:
- Home -> Circulation -> Checkout
- Search for a user that does not exist (I searched 'whywouldthisexist') on the intranet interface.
- Look at the intranet logs
=> FAIL: you get "Use of uninitialized value $searchtype in string eq at.,,"
- Apply the patch
- Repeat the search
=> SUCCESS: No warning
- Sign off :-D

NOTE: Other pages are more forgiving. Tweaked test plan.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Tomás Cohen Arazi 2015-06-08 19:26:44 UTC
Patch pushed to master.
Comment 5 Chris Cormack 2015-06-08 23:09:09 UTC
Pushed to 3.20.x will be in 3.20.1
Comment 6 Liz Rea 2015-06-22 23:27:45 UTC
Patch pushed to 3.18.x will be in 3.18.08
Comment 7 Mason James 2015-07-25 05:29:36 UTC
Skipping for 3.16.x series, due to patch conflicts