From: Kyle M Hall Date: Fri, 6 Sep 2013 17:10:19 +0000 (-0400) Subject: Bug 10835: fix patron search for using "contains" search type X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=49e014d5b0f10d22d9cc5a4d3871bce34f298876;p=koha.git Bug 10835: fix patron search for using "contains" search type The patron search type option "contains" works fine for multiple strings, but returns no results for a single string search. For example, the patron "Henry Acevedo" will be returned for a "contains" search "en ev" but not for just "en" or "ev". Test Plan: 1) Create 2 patrons named "Test One" and "Test Two" 2) Run a "contains" search for the term "est" 3) Note no results were found 4) Apply this patch 5) Repeat step 2 6) Note the patrons now display in the search results. Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer All tests and QA script pass. Also checked that 'starts with' still works as expected - searching for ev will only return "Eva Dillon" from the example patrons in this case. Signed-off-by: Galen Charlton --- diff --git a/members/member.pl b/members/member.pl index 47f7cb7544..f3d58476e1 100755 --- a/members/member.pl +++ b/members/member.pl @@ -111,7 +111,12 @@ if ($member || keys %$patron) { $member = output_pref(dt_from_string($member), 'iso', undef, 1); } - my $search_scope = ( $quicksearch ? "field_start_with" : "start_with" ); + my $searchtype = $input->param('searchtype'); + my $search_scope = + $quicksearch ? "field_start_with" + : $searchtype ? $searchtype + : "start_with"; + ($results) = Search( $member || $patron, \@orderby, undef, undef, \@searchfields, $search_scope ); }