From bc1d5d428c1c1b72ca87564655d99dc96648b625 Mon Sep 17 00:00:00 2001 From: sushantpaste Date: Wed, 13 Mar 2019 11:32:56 +0530 Subject: [PATCH] dev/core#787 Auto-complete search results fixes --- CRM/Contact/BAO/Query.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index abd8711a80..a32a14835d 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -3449,7 +3449,8 @@ WHERE $smartGroupClause } // Replace spaces with wildcards for a LIKE operation // UNLESS string contains a comma (this exception is a tiny bit questionable) - elseif ($op == 'LIKE' && strpos($value, ',') === FALSE) { + // Also need to check if there is space in between sort name. + elseif ($op == 'LIKE' && strpos($value, ',') === FALSE && strpos($value, ' ') === TRUE) { $value = str_replace(' ', '%', $value); } $value = CRM_Core_DAO::escapeString(trim($value)); -- 2.25.1