Bugzilla – Attachment 39911 Details for
Bug 14344
uninitialized value warning C4/Utils/DataTables/Members.pm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14344: uninitialized value warning C4/Utils/DataTables/Members.pm
Bug-14344-uninitialized-value-warning-C4UtilsDataT.patch (text/plain), 1.64 KB, created by
Tomás Cohen Arazi (tcohen)
on 2015-06-05 15:09:10 UTC
(
hide
)
Description:
Bug 14344: uninitialized value warning C4/Utils/DataTables/Members.pm
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2015-06-05 15:09:10 UTC
Size:
1.64 KB
patch
obsolete
>From 35ee53db26df6bd20243cd9d7ec3e83354d4ea9f Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Fri, 5 Jun 2015 12:01:28 -0300 >Subject: [PATCH] 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 >--- > C4/Utils/DataTables/Members.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm >index a63a582..6b365c5 100644 >--- a/C4/Utils/DataTables/Members.pm >+++ b/C4/Utils/DataTables/Members.pm >@@ -76,8 +76,8 @@ sub search { > $term .= '%' # end with anything > if $term !~ /%$/; > $term = "%$term" # begin with anythin unless start_with >- if $term !~ /^%/ >- and $searchtype eq "contain"; >+ if (defined $searchtype) && $searchtype eq "contain" >+ && $term !~ /^%/; > my @where_strs_or; > for my $searchfield ( split /,/, $searchfields->{$searchfieldstype} ) { > push @where_strs_or, "borrowers." . $dbh->quote_identifier($searchfield) . " LIKE ?"; >-- >2.4.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14344
:
39911
|
39914
|
39937