From: Coleman Watts Date: Wed, 15 Oct 2014 02:33:28 +0000 (-0400) Subject: CRM-15442 - Change spaces to wildcards in contact.getlist api X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=dc94c208acf2ad518621eb01d83e602131e021cc;p=civicrm-core.git CRM-15442 - Change spaces to wildcards in contact.getlist api --- diff --git a/api/v3/Contact.php b/api/v3/Contact.php index de3602f10a..d0c7cfabab 100644 --- a/api/v3/Contact.php +++ b/api/v3/Contact.php @@ -982,7 +982,8 @@ function _civicrm_api3_contact_getlist_params(&$request) { $request['params']['options']['sort'] = 'sort_name'; // Contact api doesn't support array(LIKE => 'foo') syntax if (!empty($request['input'])) { - $request['params'][$request['search_field']] = $request['input']; + // CRM-15442 - change spaces to % wildcards when searching by name + $request['params'][$request['search_field']] = strpos($request['search_field'], 'name') ? str_replace(' ', '%', $request['input']) : $request['input']; } }