From 11323362709832a15bfab2f38e26bdb5e1486984 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 14 Feb 2017 15:22:40 +0000 Subject: [PATCH] Bug 18094: Only search in searchable patron attributes if searching in standard fields Test plan: - Add a new patron attrbute and mark it searchable - Populate a new patron with 'potato' in that field - Add/edit another patron to have email potato@invalidemail.com' - Perform a patron search with query 'potato' (in standard fields) => Both patrons are returned - Perform a patron search with filters 'Email' and query 'potato' => Only 1 patron is returned and you are redirected to the patron detail page. --- C4/Utils/DataTables/Members.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm index 5b5a9ac..302eaff 100644 --- a/C4/Utils/DataTables/Members.pm +++ b/C4/Utils/DataTables/Members.pm @@ -120,7 +120,7 @@ sub search { push @where_args, $term; } - if ( C4::Context->preference('ExtendedPatronAttributes') and $searchmember ) { + if ( $searchfieldstype eq 'standard' and C4::Context->preference('ExtendedPatronAttributes') and $searchmember ) { my $matching_borrowernumbers = C4::Members::Attributes::SearchIdMatchingAttribute($searchmember); for my $borrowernumber ( @$matching_borrowernumbers ) { -- 2.1.4