From 7e6c32e8e5bd7f25bbe68c0e1fa698a840344706 Mon Sep 17 00:00:00 2001 From: Web Access Date: Fri, 16 Jan 2015 18:24:48 +0530 Subject: [PATCH] Fix for CRM-15830 --- CRM/Contact/Form/Contact.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index 7e11455b8c..6186efc27a 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -866,7 +866,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { $params = $this->controller->exportValues($this->_name); $group = CRM_Utils_Array::value('group', $params); - if ($group && is_array($group)) { + if (!empty($group) && is_array($group)) { unset($params['group']); foreach ($group as $key => $value) { $params['group'][$value] = 1; @@ -951,11 +951,11 @@ 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)) { + if (!array_key_exists('TagsAndGroups', $this->_editOptions) && !empty($params['group'])) { unset($params['group']); } - if (!empty($params['contact_id']) && ($this->_action & CRM_Core_Action::UPDATE)) { + if (!empty($params['contact_id']) && ($this->_action & CRM_Core_Action::UPDATE) && !empty($params['group'])) { // 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