From 94a33a7a439338a72867ccbee03e8a87a74fea29 Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Thu, 21 Nov 2019 13:32:56 -0500 Subject: [PATCH] core#1411: Advanced Search crashes when some form values start with 1 --- CRM/Contact/Selector.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/Selector.php b/CRM/Contact/Selector.php index 1e9a3b0ee5..faf4e64e2d 100644 --- a/CRM/Contact/Selector.php +++ b/CRM/Contact/Selector.php @@ -1039,11 +1039,11 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se // the other alternative of running the FULL query will just be incredibly inefficient // and slow things down way too much on large data sets / complex queries - $selectSQL = "SELECT DISTINCT %1, contact_a.id, contact_a.sort_name"; + $selectSQL = CRM_Core_DAO::composeQuery("SELECT DISTINCT %1, contact_a.id, contact_a.sort_name", [1 => [$cacheKey, 'String']]); $sql = str_ireplace(["SELECT contact_a.id as contact_id", "SELECT contact_a.id as id"], $selectSQL, $sql); try { - Civi::service('prevnext')->fillWithSql($cacheKey, $sql, [1 => [$cacheKey, 'String']]); + Civi::service('prevnext')->fillWithSql($cacheKey, $sql); } catch (CRM_Core_Exception $e) { if ($coreSearch) { -- 2.25.1