From: kurund Date: Tue, 4 Mar 2014 07:12:08 +0000 (+0530) Subject: fixed duplicate count of relationship, CRM-14201 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=075fa74e2b7d79ff0cdd01ca963f267068a29874;p=civicrm-core.git fixed duplicate count of relationship, CRM-14201 ---------------------------------------- * CRM-14201: Contact Relationships tab needs pagination http://issues.civicrm.org/jira/browse/CRM-14201 --- 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) {