Bug 14344 - uninitialized value warning C4/Utils/DataTables/Members.pm
Summary: uninitialized value warning C4/Utils/DataTables/Members.pm
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-05 14:56 UTC by Tomás Cohen Arazi
Modified: 2016-12-05 21:22 UTC (History)
4 users (show)

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


Attachments
Bug 14344: uninitialized value warning C4/Utils/DataTables/Members.pm (1.64 KB, patch)
2015-06-05 15:09 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 14344: uninitialized value warning C4/Utils/DataTables/Members.pm (1.80 KB, patch)
2015-06-05 16:48 UTC, M. Tompsett
Details | Diff | Splinter Review
[PASSED QA] Bug 14344: uninitialized value warning C4/Utils/DataTables/Members.pm (1.86 KB, patch)
2015-06-06 14:14 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 M. 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