Skip to content

Commit

Permalink
Merge pull request #16979 from eileenmcnaughton/cw
Browse files Browse the repository at this point in the history
Use isSerialized function rather guessing from html_type
  • Loading branch information
eileenmcnaughton authored Apr 5, 2020
2 parents e546963 + 726e45e commit cb94806
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CRM/Contribute/Import/Parser/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ private function deprecatedFormatParams($params, &$values, $create = FALSE, $onD
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] = [];
Expand Down
2 changes: 1 addition & 1 deletion CRM/Event/Import/Parser/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ protected function formatValues(&$values, $params) {
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] = [];
Expand Down
2 changes: 1 addition & 1 deletion CRM/Member/Import/Parser/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ public function membership_format_params($params, &$values, $create = FALSE) {
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] = [];
Expand Down
2 changes: 1 addition & 1 deletion CRM/Utils/DeprecatedUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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] = [];
Expand Down

0 comments on commit cb94806

Please sign in to comment.