From 0808ea6aff2061e78aeedb4e14176bee7c169f0c Mon Sep 17 00:00:00 2001 From: Mathieu Lutfy Date: Wed, 22 Nov 2017 12:24:16 -0500 Subject: [PATCH] CRM-21469: Fix removal from all groups from Edit Contact. --- CRM/Contact/Form/Contact.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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)) { -- 2.25.1