dev/core/issues/700, Show Qill when searched using contact id
authorPradeep Nayak <pradpnayak@gmail.com>
Wed, 6 Feb 2019 17:50:15 +0000 (17:50 +0000)
committerPradeep Nayak <pradpnayak@gmail.com>
Wed, 6 Feb 2019 17:50:15 +0000 (17:50 +0000)
CRM/Contact/BAO/Query.php

index 92c47c34bff0c7352c8eeac0ddb31501b660b11a..2db3cb961640b7d3816388f28a3c09d4a2f82199 100644 (file)
@@ -2039,6 +2039,18 @@ class CRM_Contact_BAO_Query {
         // check for both id and contact_id
         if ($this->_params[$id][0] == 'id' || $this->_params[$id][0] == 'contact_id') {
           $this->_where[0][] = self::buildClause("contact_a.id", $this->_params[$id][1], $this->_params[$id][2]);
+          $field = CRM_Utils_Array::value('id', $this->_fields);
+          list($qillop, $qillVal) = CRM_Contact_BAO_Query::buildQillForFieldValue(
+            'CRM_Contact_BAO_Contact',
+            "contact_a.id",
+            $this->_params[$id][2],
+            $this->_params[$id][1]
+          );
+          $this->_qill[0][] = ts("%1 %2 %3", [
+            1 => $field['title'],
+            2 => $qillop,
+            3 => $qillVal
+          ]);
         }
         else {
           $this->whereClauseSingle($this->_params[$id], $apiEntity);