//CRM-16087 removed additional call to function relatedMemberships which is already called by disableEnableRelationship
//resulting in memership being created twice
- self::disableEnableRelationship($params['id'], $action, $params, $ids);
+ if (array_key_exists('is_active', $params) && empty($params['is_active'])) {
+ $action = CRM_Core_Action::DISABLE;
+ $active = FALSE;
+ }
+ else {
+ $action = CRM_Core_Action::ENABLE;
+ $active = TRUE;
+ }
+ self::disableEnableRelationship($params['id'], $action, $params, $ids, $active);
}
self::addRecent($params, $relationship);
'contact_check' => array($relationship->contact_id_b => 1),
);
}
- else {
- if (array_key_exists('is_active', $params) && empty($params['is_active'])) {
- $action = CRM_Core_Action::DISABLE;
- }
- else {
- $action = CRM_Core_Action::ENABLE;
- $active = TRUE;
- }
- }
$contact_id_a = empty($params['contact_id_a']) ? $relationship->contact_id_a : $params['contact_id_a'];
// calling relatedMemberships to delete/add the memberships of
// related contacts.