From c23fcc07431f57081b27e692277f174e61d8049b Mon Sep 17 00:00:00 2001 From: monishdeb Date: Sat, 11 Jul 2015 00:05:20 +0530 Subject: [PATCH] minor fix --- CRM/Contact/BAO/Relationship.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index d5f2f123b1..c026062f0f 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -971,7 +971,7 @@ WHERE relationship_type_id = " . CRM_Utils_Type::escape($type, 'Integer'); } // get the total count of relationships - $v['totalCount'] = CRM_Contact_BAO_Relationship::getRelationship($params['contact_id'], NULL, NULL, TRUE); + $v['totalCount'] = count($v['data']); $values['relationship']['data'] = &$v['data']; $values['relationship']['totalCount'] = &$v['totalCount']; @@ -1222,6 +1222,7 @@ LEFT JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id) $mask = $mask & $permissionMask; } } + while ($relationship->fetch()) { $rid = $relationship->civicrm_relationship_id; $cid = $relationship->civicrm_contact_id; @@ -1974,8 +1975,7 @@ AND cc.sort_name LIKE '%$name%'"; if (!empty($relationships)) { // get the total relationships if ($params['context'] != 'user') { - $params['total'] = CRM_Contact_BAO_Relationship::getRelationship($params['contact_id'], - $relationshipStatus, 0, 1, 0, NULL, NULL, $permissionedContacts); + $params['total'] = count($relationships); } else { // FIX ME: we cannot directly determine total permissioned relationship, hence re-fire query -- 2.25.1