CRM-16653 fix - Database error when searching for certain relationship types
authormonishdeb <monish.deb@webaccessglobal.com>
Thu, 11 Jun 2015 11:38:22 +0000 (17:08 +0530)
committermonishdeb <monish.deb@webaccessglobal.com>
Thu, 11 Jun 2015 11:38:22 +0000 (17:08 +0530)
https://issues.civicrm.org/jira/browse/CRM-16653

CRM/Contact/BAO/Query.php

index 226a664c700bfe7855ff4d551708ad0791d51029..3c86767ddb80263c2b62e429fabbbc54be38ee07 100644 (file)
@@ -4192,6 +4192,7 @@ civicrm_relationship.is_permission_a_b = 0
       $whereClause = '';
       if (!empty($where[$grouping])) {
         $whereClause = ' WHERE ' . implode(' AND ', $where[$grouping]);
+        $whereClause = str_replace('contact_b', 'c', $whereClause);
       }
       $sql = "
         CREATE TEMPORARY TABLE {$relationshipTempTable}