Use isSerialized function rather guessing from html_type
authorColeman Watts <coleman@civicrm.org>
Fri, 3 Apr 2020 14:38:28 +0000 (10:38 -0400)
committereileen <emcnaughton@wikimedia.org>
Sun, 5 Apr 2020 02:24:03 +0000 (14:24 +1200)
CRM/Contribute/Import/Parser/Contribution.php
CRM/Event/Import/Parser/Participant.php
CRM/Member/Import/Parser/Membership.php
CRM/Utils/DeprecatedUtils.php

index cda0249e65642143237e4461b14d164be49b90e9..0ab29840850adc20491b0ff3b107563e7ef93221 100644 (file)
@@ -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] = [];
index c5c47da4c6d85f27416c75ec5d851ea9c3d48c6c..a3f5142787fcd4bf811d38f52f7c33f63a98f93e 100644 (file)
@@ -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] = [];
index 0a1bd220ab4e8f3c879f72c2b1ddfbe33798a677..abd91e7e9c636271c0e7d9e1df38af98ddecf2e3 100644 (file)
@@ -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] = [];
index b6da19bb686fe5e803fb2b778df9f49228533471..4e5e9ce3f083ed8b17e8e40ddc87689e28b46fd6 100644 (file)
@@ -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] = [];