From 075fa74e2b7d79ff0cdd01ca963f267068a29874 Mon Sep 17 00:00:00 2001 From: kurund Date: Tue, 4 Mar 2014 12:42:08 +0530 Subject: [PATCH] fixed duplicate count of relationship, CRM-14201 ---------------------------------------- * CRM-14201: Contact Relationships tab needs pagination http://issues.civicrm.org/jira/browse/CRM-14201 --- CRM/Contact/BAO/Relationship.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index ff62ead670..6f4b257125 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -875,7 +875,9 @@ LEFT JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id) $where .= ' AND civicrm_relationship.contact_id_b = ' . CRM_Utils_Type::escape($contactId, 'Positive'); } else { - $where .= ' AND civicrm_relationship.contact_id_a = ' . CRM_Utils_Type::escape($contactId, 'Positive'); + $where .= ' AND civicrm_relationship.contact_id_a = ' . CRM_Utils_Type::escape($contactId, 'Positive') . ' + AND civicrm_relationship.contact_id_a != civicrm_relationship.contact_id_b '; + } } if ($relationshipId) { -- 2.25.1