Skip to content

Commit

Permalink
GroupContact.delete is deprecated (#1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
demeritcowboy authored Jan 20, 2025
1 parent 8970f26 commit f95d307
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/WebformCivicrmPostProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,13 @@ private function addOrRemoveMultivaluedData($data_type, $entity_type, $id, $add,
// Remove data from entity
foreach ($remove as $a => $name) {
$params[$data_type . '_id'] = $a;
$this->utils->wf_civicrm_api($api, 'delete', $params);
if ($data_type == 'group') {
// group_contact.delete is deprecated and it just called create.
$this->utils->wf_civicrm_api($api, 'create', array_merge(['status' => 'Removed'], $params));
}
else {
$this->utils->wf_civicrm_api($api, 'delete', $params);
}
}
if (!empty($remove) && $data_type == 'group') {
$display_name = $this->utils->wf_civicrm_api('contact', 'get', ['contact_id' => $id, 'return.display_name' => 1]);
Expand Down

0 comments on commit f95d307

Please sign in to comment.