Revert CRM-17067 fix
authormonishdeb <monish.deb@webaccessglobal.com>
Mon, 21 Sep 2015 14:39:14 +0000 (20:09 +0530)
committermonishdeb <monish.deb@webaccessglobal.com>
Mon, 5 Oct 2015 20:33:10 +0000 (02:03 +0530)
----------------------------------------
* CRM-17067: New relationship permission enforcement has result to related membership not created via public pages
  https://issues.civicrm.org/jira/browse/CRM-17067

CRM/Contact/BAO/Relationship.php
CRM/Member/BAO/Membership.php
api/v3/Relationship.php

index e89d703fc3e72214cf88833c9d1acefa714f3c03..9eec868793bee8a26c8fe6a81526bf86fa6be5a8 100644 (file)
@@ -1159,7 +1159,6 @@ LEFT JOIN  civicrm_country ON (civicrm_address.country_id = civicrm_country.id)
     $count = 0, $relationshipId = 0,
     $links = NULL, $permissionMask = NULL,
     $permissionedContact = FALSE,
-    $action = CRM_Core_Action::BROWSE,
     $params = array()
   ) {
     $values = array();
@@ -1233,8 +1232,7 @@ LEFT JOIN  civicrm_country ON (civicrm_address.country_id = civicrm_country.id)
       while ($relationship->fetch()) {
         $rid = $relationship->civicrm_relationship_id;
         $cid = $relationship->civicrm_contact_id;
-        if (($action & CRM_Core_Action::BROWSE) &&
-          $permissionedContact &&
+        if ($permissionedContact &&
           (!CRM_Contact_BAO_Contact_Permission::relationship($cid, $contactId))
         ) {
           continue;
index 71118a61b783f61fded9cebc534fdc03d5c56ed5..8fd061802b9e759677aa0660edb72eb807629e3c 100644 (file)
@@ -457,11 +457,11 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership {
     $relationships = array();
     if (isset($membershipType['relationship_type_id'])) {
       $relationships = CRM_Contact_BAO_Relationship::getRelationship($contactId,
-        CRM_Contact_BAO_Relationship::CURRENT, NULL, NULL, NULL, NULL, NULL, FALSE, $action
+        CRM_Contact_BAO_Relationship::CURRENT
       );
       if ($action & CRM_Core_Action::UPDATE) {
         $pastRelationships = CRM_Contact_BAO_Relationship::getRelationship($contactId,
-          CRM_Contact_BAO_Relationship::PAST, NULL, NULL, NULL, NULL, NULL, FALSE, $action
+          CRM_Contact_BAO_Relationship::PAST
         );
         $relationships = array_merge($relationships, $pastRelationships);
       }
index 785f4e03d64492e8a99256e025e1252049f8ee95..71f84029c3969da9dfab3491e26d96365a717290 100644 (file)
@@ -116,7 +116,6 @@ function civicrm_api3_relationship_get($params) {
       NULL,
       NULL,
       FALSE,
-      NULL,
       $params
     );
   }