- if ($type == 'CheckBox' || $type == 'Multi-Select') {
- $mulValues = explode(',', $value);
- $customOption = CRM_Core_BAO_CustomOption::getCustomOption($customFieldID, TRUE);
- $values[$key] = [];
- foreach ($mulValues as $v1) {
- foreach ($customOption as $customValueID => $customLabel) {
- $customValue = $customLabel['value'];
- if ((strtolower(trim($customLabel['label'])) == strtolower(trim($v1))) ||
- (strtolower(trim($customValue)) == strtolower(trim($v1)))
- ) {
- if ($type == 'CheckBox') {
- $values[$key][$customValue] = 1;
- }
- else {
- $values[$key][] = $customValue;
- }
- }
- }
- }
+ if (CRM_Core_BAO_CustomField::isSerialized($customFields[$customFieldID])) {
+ $values[$key] = CRM_Import_Parser::unserializeCustomValue($customFieldID, $value, $type);