diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index 0c9eb8fbc842..7102c404d9c3 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -992,8 +992,10 @@ public function postProcess() { if (array_key_exists('TagsAndGroups', $this->_editOptions)) { //add contact to tags - $params['tag'] = array_flip(explode(',', $params['tag'])); - CRM_Core_BAO_EntityTag::create($params['tag'], 'civicrm_contact', $params['contact_id']); + if (isset($params['tag']) && !empty($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'])) { diff --git a/CRM/Contact/Form/Edit/TagsAndGroups.php b/CRM/Contact/Form/Edit/TagsAndGroups.php index 87b5d418917d..1518c2a119e0 100644 --- a/CRM/Contact/Form/Edit/TagsAndGroups.php +++ b/CRM/Contact/Form/Edit/TagsAndGroups.php @@ -128,7 +128,7 @@ public static function buildQuickForm( if ($groupElementType == 'select' && !empty($groupsOptions)) { $form->add('select', $fName, $groupName, $groupsOptions, FALSE, - array('id' => $fName, 'multiple' => 'multiple', 'class' => 'crm-select2', 'style' => 'width: 310px') + array('id' => $fName, 'multiple' => 'multiple', 'class' => 'crm-select2 twenty') ); $form->assign('groupCount', count($groupsOptions)); } @@ -150,11 +150,11 @@ public static function buildQuickForm( if (!empty($tags)) { $form->add('select2', 'tag', ts('Tag(s)'), $tags, FALSE, array('class' => 'huge', 'placeholder' => ts('- select -'), 'multiple' => TRUE)); } - } - // build tag widget - $parentNames = CRM_Core_BAO_Tag::getTagSet('civicrm_contact'); - CRM_Core_Form_Tag::buildQuickForm($form, $parentNames, 'civicrm_contact', $contactId, FALSE, TRUE); + // build tag widget + $parentNames = CRM_Core_BAO_Tag::getTagSet('civicrm_contact'); + CRM_Core_Form_Tag::buildQuickForm($form, $parentNames, 'civicrm_contact', $contactId, FALSE, TRUE); + } $form->assign('tagGroup', $form->_tagGroup); } @@ -195,7 +195,6 @@ public static function setDefaults($id, &$defaults, $type = self::ALL, $fieldNam if ($type & self::TAG) { $defaults['tag'] = implode(',', CRM_Core_BAO_EntityTag::getTag($id, 'civicrm_contact')); - CRM_Core_Error::debug_var('tag', $defaults['tag']); } } diff --git a/templates/CRM/Contact/Form/Edit/TagsAndGroups.tpl b/templates/CRM/Contact/Form/Edit/TagsAndGroups.tpl index 2c14b4ef981a..e13c4c50d23f 100644 --- a/templates/CRM/Contact/Form/Edit/TagsAndGroups.tpl +++ b/templates/CRM/Contact/Form/Edit/TagsAndGroups.tpl @@ -23,65 +23,6 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -{literal} - - - {if $title}