Merge branch '4.4' of https://github.com/civicrm/civicrm-core
[civicrm-core.git] / api / v3 / GroupContact.php
index 42cdfc6163f809222f8ed308aa892b37ad828f66..85bfa5494161e65f92198011d82c0a87d3402199 100644 (file)
@@ -3,7 +3,7 @@
 
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
@@ -228,10 +228,13 @@ function civicrm_api3_group_contact_update_status($params) {
 
   civicrm_api3_verify_mandatory($params, NULL, array('contact_id', 'group_id'));
 
-  $method = CRM_Utils_Array::value('method', $params, 'API');
-  $tracking = CRM_Utils_Array::value('tracking', $params);
-
-  CRM_Contact_BAO_GroupContact::updateGroupMembershipStatus($params['contact_id'], $params['group_id'], $method, $tracking);
+  CRM_Contact_BAO_GroupContact::addContactsToGroup(
+    array($params['contact_id']),
+    $params['group_id'],
+    CRM_Utils_Array::value('method', $params, 'API'),
+    'Added',
+    CRM_Utils_Array::value('tracking', $params)
+  );
 
   return TRUE;
 }