From: Mathieu Lutfy Date: Wed, 22 Nov 2017 17:24:16 +0000 (-0500) Subject: CRM-21469: Fix removal from all groups from Edit Contact. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0808ea6aff2061e78aeedb4e14176bee7c169f0c;p=civicrm-core.git CRM-21469: Fix removal from all groups from Edit Contact. --- diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index 2a14de16e9..e65b49d2d6 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -943,11 +943,10 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { // process shared contact address. CRM_Contact_BAO_Contact_Utils::processSharedAddress($params['address']); - if (!array_key_exists('TagsAndGroups', $this->_editOptions) && !empty($params['group'])) { + if (!array_key_exists('TagsAndGroups', $this->_editOptions)) { unset($params['group']); } - - if (!empty($params['contact_id']) && ($this->_action & CRM_Core_Action::UPDATE) && !empty($params['group'])) { + elseif (!empty($params['contact_id']) && ($this->_action & CRM_Core_Action::UPDATE)) { // figure out which all groups are intended to be removed $contactGroupList = CRM_Contact_BAO_GroupContact::getContactGroup($params['contact_id'], 'Added'); if (is_array($contactGroupList)) {