X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FBAO%2FCustomGroup.php;h=8f0fea34950c44a24e96c71ed698e93fd151e7e3;hb=01f1409c41cf0f9202763d15f3c3e5ae523e191a;hp=61da4970e4f8c3e300a871d8fa73c11f9dc792c1;hpb=18d905e0280be35e583250c3da8e63291db47f30;p=civicrm-core.git diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index 61da4970e4..8f0fea3495 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -1355,8 +1355,13 @@ ORDER BY civicrm_custom_group.weight, CRM_Utils_Array::formatArrayKeys($value); $checkedValue = $value; } + // Serialized values from db + elseif ($value === '' || strpos($value, CRM_Core_DAO::VALUE_SEPARATOR) !== FALSE) { + $checkedValue = CRM_Utils_Array::explodePadded($value); + } + // Comma-separated values e.g. from a select2 widget during reload on form error else { - $checkedValue = explode(CRM_Core_DAO::VALUE_SEPARATOR, substr($value, 1, -1)); + $checkedValue = explode(',', $value); } foreach ($checkedValue as $val) { if ($val) { @@ -1383,7 +1388,7 @@ ORDER BY civicrm_custom_group.weight, elseif ($field['data_type'] == 'Money' && $field['html_type'] == 'Text' ) { - $defaults[$elementName] = CRM_Utils_Money::format($value, NULL, '%a'); + $defaults[$elementName] = CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency($value); } else { $defaults[$elementName] = $value;