Remove contact tags when none selected on edit screen
authorPradeep Nayak <pradpnayak@gmail.com>
Thu, 18 Oct 2018 14:38:01 +0000 (15:38 +0100)
committerColeman Watts <coleman@civicrm.org>
Sat, 20 Oct 2018 15:15:19 +0000 (11:15 -0400)
CRM/Contact/Form/Contact.php

index b78eb31383ade9393323b9c6a1e62657ea00b101..c3e5ece66cc16e42c894301fdc778d2f70aade14 100644 (file)
@@ -1004,11 +1004,10 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
 
     if (array_key_exists('TagsAndGroups', $this->_editOptions)) {
       //add contact to tags
-      if (isset($params['tag']) && !empty($params['tag'])) {
+      if (isset($params['tag'])) {
         $params['tag'] = array_flip(explode(',', $params['tag']));
         CRM_Core_BAO_EntityTag::create($params['tag'], 'civicrm_contact', $params['contact_id']);
       }
-
       //save free tags
       if (isset($params['contact_taglist']) && !empty($params['contact_taglist'])) {
         CRM_Core_Form_Tag::postProcess($params['contact_taglist'], $params['contact_id'], 'civicrm_contact', $this);