@@ -, +, @@ --- C4/Utils/DataTables/Members.pm | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) --- a/C4/Utils/DataTables/Members.pm +++ a/C4/Utils/DataTables/Members.pm @@ -88,22 +88,20 @@ sub search { foreach my $term (@terms) { next unless $term; - my $termsearchfieldstype; - my $term_is_dt = eval { local $SIG{__WARN__}={}; Koha::DateUtils::output_pref( { str=>$term, dateonly=>1, dateformat=>'sql' } ); }; + my $term_dt = eval { local $SIG{__WARN__} = {}; output_pref( { str => $term, dateonly => 1, dateformat => 'sql' } ); }; - if ( $term_is_dt ){ - $termsearchfieldstype = 'dateofbirth' ; - $term = $term_is_dt; + if ($term_dt) { + $searchfieldstype = 'dateofbirth'; + $term = $term_dt; } else { - $termsearchfieldstype = $searchfieldstype; - $term .= '%' # end with anything - if $term !~ /%$/; - $term = "%$term" # begin with anythin unless start_with - if $searchtype eq 'contain' && $term !~ /^%/; + $term .= '%' # end with anything + if $term !~ /%$/; + $term = "%$term" # begin with anythin unless start_with + if $searchtype eq 'contain' && $term !~ /^%/; } my @where_strs_or; - for my $searchfield ( split /,/, $searchfields->{$termsearchfieldstype} ) { + for my $searchfield ( split /,/, $searchfields->{$searchfieldstype} ) { push @where_strs_or, "borrowers." . $dbh->quote_identifier($searchfield) . " LIKE ?"; push @where_args, $term; } @@ -145,8 +143,6 @@ sub search { ($limit ? $limit : "") ); my $sth = $dbh->prepare($query); - warn Data::Dumper::Dumper( $query ); - warn Data::Dumper::Dumper( @where_args ); $sth->execute(@where_args); my $patrons = $sth->fetchall_arrayref({}); --