From 0d77b56a9db35a6452ca7b41de0e00be312a5568 Mon Sep 17 00:00:00 2001 From: Pratik Joshi Date: Thu, 12 Dec 2013 15:43:05 +0530 Subject: [PATCH] CRM-13907 --- CRM/Contact/BAO/Query.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index d670cd4b5f..6b981e6f41 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -1987,9 +1987,11 @@ class CRM_Contact_BAO_Query { $op = 'LIKE'; } $wc = self::caseImportant($op) ? "LOWER(contact_a.organization_name)" : "contact_a.organization_name"; - $this->_where[$grouping][] = self::buildClause($wc, $op, - "'$value' AND contact_a.contact_type ='Individual'" + $ceWhereClause = self::buildClause($wc, $op, + $value ); + $ceWhereClause .= " AND contact_a.contact_type = 'Individual'"; + $this->_where[$grouping][] = $ceWhereClause; $this->_qill[$grouping][] = "$field[title] $op \"$value\""; } elseif ($name === 'email_greeting') { @@ -2029,7 +2031,7 @@ class CRM_Contact_BAO_Query { } $wc = 'civicrm_website.url'; - $this->_where[$grouping][] = self::buildClause($wc, $op, "'$value'"); + $this->_where[$grouping][] = $d = self::buildClause($wc, $op, $value); $this->_qill[$grouping][] = "$field[title] $op \"$value\""; } elseif ($name === 'contact_is_deleted') { @@ -4876,7 +4878,6 @@ SELECT COUNT( civicrm_contribution.total_amount ) as cancel_count, } $value = CRM_Utils_Type::escape($value, $dataType); - // if we dont have a dataType we should assume if ($dataType == 'String' || $dataType == 'Text') { $value = "'" . strtolower($value) . "'"; -- 2.25.1