From 2e155dbd804d5c28d97b1a64b8981bee3d69c815 Mon Sep 17 00:00:00 2001 From: Pratik Joshi Date: Mon, 4 Nov 2013 19:16:04 +0530 Subject: [PATCH] CRM-13684 fix ---------------------------------------- * CRM-13684: Profile Search using http://issues.civicrm.org/jira/browse/CRM-13684 --- CRM/Contact/BAO/Query.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 5b74122c89..78010bf4a8 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -1833,8 +1833,8 @@ class CRM_Contact_BAO_Query { $locationType = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'); if (substr($name, 0, 14) === 'state_province') { - $setTables = FALSE; if (isset($locType[1]) && is_numeric($locType[1])) { + $setTables = FALSE; $aName = "{$locationType[$locType[1]]}-address"; $where = "`$aName`.state_province_id"; } @@ -1872,8 +1872,8 @@ class CRM_Contact_BAO_Query { } } elseif (substr($name, 0, 7) === 'country') { - $setTables = FALSE; if (isset($locType[1]) && is_numeric($locType[1])) { + $setTables = FALSE; $aName = "{$locationType[$locType[1]]}-address"; $where = "`$aName`.country_id"; } @@ -1890,6 +1890,7 @@ class CRM_Contact_BAO_Query { $intVal = CRM_Utils_Array::key($value, $countries); $this->_where[$grouping][] = self::buildClause($where, $op, $intVal, 'Positive'); } + if (!$lType) { $this->_qill[$grouping][] = ts('Country') . " $op '$value'"; } @@ -1898,8 +1899,8 @@ class CRM_Contact_BAO_Query { } } elseif (substr($name, 0, 6) === 'county') { - $setTables = FALSE; if (isset($locType[1]) && is_numeric($locType[1])) { + $setTables = FALSE; $aName = "{$locationType[$locType[1]]}-address"; $where = "`$aName`.county_id"; } -- 2.25.1