CRM-18554: Using IS EMPTY operator for some date fields crashes 4.7.7
authoryashodha <yashodha.chaku@webaccessglobal.com>
Tue, 7 Jun 2016 06:56:20 +0000 (12:26 +0530)
committeryashodha <yashodha.chaku@webaccessglobal.com>
Tue, 7 Jun 2016 06:56:20 +0000 (12:26 +0530)
----------------------------------------
* CRM-18554: Using IS EMPTY operator for some date fields crashes 4.7.7
  https://issues.civicrm.org/jira/browse/CRM-18554

CRM/Contact/BAO/Query.php

index 537744ad75433444cd536eee0ff6c1563fa717c7..91cfb0f6145b935464c191d303d50cda8c69743d 100644 (file)
@@ -5085,10 +5085,10 @@ SELECT COUNT( conts.total_amount ) as cancel_count,
       }
 
       if ($date) {
-        $this->_where[$grouping][] = "{$tableName}.{$dbFieldName} $op $date";
+        $this->_where[$grouping][] = self::buildClause("{$tableName}.{$dbFieldName}", $op, $date);
       }
       else {
-        $this->_where[$grouping][] = "{$tableName}.{$dbFieldName} $op";
+        $this->_where[$grouping][] = self::buildClause("{$tableName}.{$dbFieldName}", $op);
       }
 
       $this->_tables[$tableName] = $this->_whereTables[$tableName] = 1;