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
Created attachment 39911 [details] [review] 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: - In current master, search for a user (I searched 'acevedo') 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
Created attachment 39914 [details] [review] 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>
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>
Patch pushed to master.
Pushed to 3.20.x will be in 3.20.1
Patch pushed to 3.18.x will be in 3.18.08
Skipping for 3.16.x series, due to patch conflicts