From 518dd0e7eadeffca7c4e67115d45ea68be0f743d Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Tue, 7 Feb 2017 10:36:03 +1100 Subject: [PATCH] CRM-19979 Also check to see if there is a record in the pending status as well as removed and added --- api/v3/GroupContact.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/v3/GroupContact.php b/api/v3/GroupContact.php index 50378c1d96..79e9e351e1 100644 --- a/api/v3/GroupContact.php +++ b/api/v3/GroupContact.php @@ -161,7 +161,8 @@ function civicrm_api3_group_contact_delete($params) { $checkParams['status'] = 'removed'; } $groupContact2 = civicrm_api3('GroupContact', 'get', $checkParams); - if ($groupContact['count'] == 0 && $groupContact2['count'] == 0) { + $groupContact3 = civicrm_api3('GroupContact', 'get', array_merge($checkParams, array('status' => 'Pending'))); + if ($groupContact['count'] == 0 && $groupContact2['count'] == 0 && $groupContact3['count'] == 0) { throw new API_Exception('Cannot Delete GroupContact'); } $params['status'] = CRM_Utils_Array::value('status', $params, empty($params['skip_undelete']) ? 'Removed' : 'Deleted'); -- 2.25.1