Bug 13232: Search patrons by a first letter should not redirect to a patron detail...
authorJonathan Druart <jonathan.druart@biblibre.com>
Wed, 12 Nov 2014 09:02:15 +0000 (10:02 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 14 Nov 2014 12:33:00 +0000 (09:33 -0300)
Bug 12833 allows to find a patron with his cardnumber.
But this won't never append if the firstletter parameter is given.

Actually the firstletter param is the only one to take into account if
it exists.

Test plan:
Search patrons by a first letter and verify that the feature is back.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
To reproduce the problem you need at least one borrower with a blank
cardnumber

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
works as descrobed, no problems found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
svc/members/search

index e0b64a5..7359258 100755 (executable)
@@ -58,7 +58,12 @@ foreach (grep {$_ =~ /^mDataProp/} keys %dt_params) {
 }
 
 my $results;
-if ( $searchfieldstype and $searchfieldstype eq 'standard' ) {
+# If the user filled a term, maybe it's a cardnumber.
+# This cannot be the case if a first letter is given.
+if (    not $firstletter
+    and $searchfieldstype
+    and $searchfieldstype eq 'standard' )
+{
     my $member = C4::Members::GetMember( cardnumber => $searchmember );
     $results = {
         iTotalRecords        => 1,