additional changes for CRM-15889
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 26 Feb 2015 11:52:45 +0000 (17:22 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Fri, 27 Feb 2015 13:02:01 +0000 (18:32 +0530)
CRM/Contact/BAO/Relationship.php
CRM/Contact/Form/Relationship.php

index 87ac2ad6dd8ca8a07951ad74fbb0bce7e55dda81..62f2ae86a5ef01e66168767d6c0c8dd089af6277 100644 (file)
@@ -206,7 +206,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship {
     //@todo hook are called from create and add - remove one
     CRM_Utils_Hook::pre($hook, 'Relationship', $relationshipId, $params);
 
-    self::setContactABFromIDs($params);
+    self::setContactABFromIDs($params, $ids);
     $relationshipTypes = CRM_Utils_Array::value('relationship_type_id', $params);
 
     // explode the string with _ to get the relationship type id
index 6bda27e56025e37d233dd6cd38363e5622d31cae..9d8722ce65e5fc063bf41224506b66318425bfce 100644 (file)
@@ -519,7 +519,7 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form {
     // Membership for related contacts CRM-1657
     if (CRM_Core_Permission::access('CiviMember') && (!$duplicate)) {
       $params['relationship_ids'] = $relationshipIds;
-      if ($this->_action & CRM_Core_Action::ADD) {
+      if ($this->_action & CRM_Core_Action::ADD && !empty($params['is_active'])) {
         CRM_Contact_BAO_Relationship::relatedMemberships($this->_contactId,
           $params, $ids,
           $this->_action