fixed duplicate count of relationship, CRM-14201
authorkurund <kurund@civicrm.org>
Tue, 4 Mar 2014 07:12:08 +0000 (12:42 +0530)
committerkurund <kurund@civicrm.org>
Tue, 4 Mar 2014 07:12:08 +0000 (12:42 +0530)
----------------------------------------
* CRM-14201: Contact Relationships tab needs pagination
  http://issues.civicrm.org/jira/browse/CRM-14201

CRM/Contact/BAO/Relationship.php

index ff62ead6704b27e62b08acea3d533385088fe76b..6f4b25712563d2f5f1c0860fdc0af96e6af1a245 100644 (file)
@@ -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) {