From: Coleman Watts Date: Fri, 3 Apr 2020 14:38:28 +0000 (-0400) Subject: Use isSerialized function rather guessing from html_type X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=726e45e765bbb8cfc7a067833b12933ecfd5b3ad;p=civicrm-core.git Use isSerialized function rather guessing from html_type --- diff --git a/CRM/Contribute/Import/Parser/Contribution.php b/CRM/Contribute/Import/Parser/Contribution.php index cda0249e65..0ab2984085 100644 --- a/CRM/Contribute/Import/Parser/Contribution.php +++ b/CRM/Contribute/Import/Parser/Contribution.php @@ -652,7 +652,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($key)) { $values[$key] = $value; $type = $customFields[$customFieldID]['html_type']; - if ($type == 'CheckBox' || $type == 'Multi-Select') { + if (CRM_Core_BAO_CustomField::isSerialized($customFields[$customFieldID])) { $mulValues = explode(',', $value); $customOption = CRM_Core_BAO_CustomOption::getCustomOption($customFieldID, TRUE); $values[$key] = []; diff --git a/CRM/Event/Import/Parser/Participant.php b/CRM/Event/Import/Parser/Participant.php index c5c47da4c6..a3f5142787 100644 --- a/CRM/Event/Import/Parser/Participant.php +++ b/CRM/Event/Import/Parser/Participant.php @@ -512,7 +512,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($key)) { $values[$key] = $value; $type = $customFields[$customFieldID]['html_type']; - if ($type == 'CheckBox' || $type == 'Multi-Select') { + if (CRM_Core_BAO_CustomField::isSerialized($customFields[$customFieldID])) { $mulValues = explode(',', $value); $customOption = CRM_Core_BAO_CustomOption::getCustomOption($customFieldID, TRUE); $values[$key] = []; diff --git a/CRM/Member/Import/Parser/Membership.php b/CRM/Member/Import/Parser/Membership.php index 0a1bd220ab..abd91e7e9c 100644 --- a/CRM/Member/Import/Parser/Membership.php +++ b/CRM/Member/Import/Parser/Membership.php @@ -630,7 +630,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($key)) { $values[$key] = $value; $type = $customFields[$customFieldID]['html_type']; - if ($type == 'CheckBox' || $type == 'Multi-Select') { + if (CRM_Core_BAO_CustomField::isSerialized($customFields[$customFieldID])) { $mulValues = explode(',', $value); $customOption = CRM_Core_BAO_CustomOption::getCustomOption($customFieldID, TRUE); $values[$key] = []; diff --git a/CRM/Utils/DeprecatedUtils.php b/CRM/Utils/DeprecatedUtils.php index b6da19bb68..4e5e9ce3f0 100644 --- a/CRM/Utils/DeprecatedUtils.php +++ b/CRM/Utils/DeprecatedUtils.php @@ -134,7 +134,7 @@ function _civicrm_api3_deprecated_activity_formatted_param(&$params, &$values, $ if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($key)) { $values[$key] = $value; $type = $customFields[$customFieldID]['html_type']; - if ($type == 'CheckBox' || $type == 'Multi-Select') { + if (CRM_Core_BAO_CustomField::isSerialized($customFields[$customFieldID])) { $mulValues = explode(',', $value); $customOption = CRM_Core_BAO_CustomOption::getCustomOption($customFieldID, TRUE); $values[$key] = [];