From dbc839f9ef0cb82879300234e0aea5ba6ffd6577 Mon Sep 17 00:00:00 2001 From: kryptothesuperdog Date: Thu, 4 May 2017 11:56:03 +0100 Subject: [PATCH] CRM-20517 - fix profile contact_sub_type issue --- CRM/Contact/BAO/Contact.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index b310eaf5f0..d547e2a6e5 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -2009,7 +2009,9 @@ ORDER BY civicrm_email.is_primary DESC"; //CRM-13596 - add to existing contact types, rather than overwriting $data_contact_sub_type_arr = CRM_Utils_Array::explodePadded($data['contact_sub_type']); if (!in_array($params['contact_sub_type_hidden'], $data_contact_sub_type_arr)) { - $data['contact_sub_type'] .= CRM_Utils_Array::implodePadded($params['contact_sub_type_hidden']); + //CRM-20517 - make sure contact_sub_type gets the correct delimiters + $data['contact_sub_type'] = trim($data['contact_sub_type'], CRM_Core_DAO::VALUE_SEPARATOR); + $data['contact_sub_type'] = CRM_Core_DAO::VALUE_SEPARATOR . $data['contact_sub_type'] . CRM_Utils_Array::implodePadded($params['contact_sub_type_hidden']); } } -- 2.25.1