From dc94c208acf2ad518621eb01d83e602131e021cc Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 14 Oct 2014 22:33:28 -0400 Subject: [PATCH] CRM-15442 - Change spaces to wildcards in contact.getlist api --- api/v3/Contact.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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']; } } -- 2.25.1