From 792750a5a0d94f513c2efbc47369e587de566eac Mon Sep 17 00:00:00 2001 From: monishdeb Date: Thu, 11 Jun 2015 17:08:22 +0530 Subject: [PATCH] CRM-16653 fix - Database error when searching for certain relationship types https://issues.civicrm.org/jira/browse/CRM-16653 --- CRM/Contact/BAO/Query.php | 1 + 1 file changed, 1 insertion(+) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 226a664c70..3c86767ddb 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -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} -- 2.25.1