Skip to content

Commit

Permalink
Merge pull request #12870 from colemanw/5.5-dev/core#391
Browse files Browse the repository at this point in the history
dev/core#391 - Fix saving tags in profile (5.5 backport)
  • Loading branch information
totten authored Sep 25, 2018
2 parents 5bc7db5 + 64546b0 commit 2d45633
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CRM/Contact/BAO/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -2032,8 +2032,10 @@ public static function createProfileContact(
CRM_Contact_BAO_GroupContact::create($params['group'], $contactID, $visibility, $method);
}

if (!empty($fields['tag'])) {
CRM_Core_BAO_EntityTag::create($params['tag'], 'civicrm_contact', $contactID);
if (!empty($fields['tag']) && array_key_exists('tag', $params)) {
// Convert comma separated form values from select2 v3
$tags = is_array($params['tag']) ? $params['tag'] : array_fill_keys(array_filter(explode(',', $params['tag'])), 1);
CRM_Core_BAO_EntityTag::create($tags, 'civicrm_contact', $contactID);
}

//to add profile in default group
Expand Down

0 comments on commit 2d45633

Please sign in to comment.