}
}
else {
+ // Values may be "array strings" or actual arrays. Handle both.
if (is_array($value) && count($value)) {
CRM_Utils_Array::formatArrayKeys($value);
$checkedValue = $value;
}
else {
if (isset($value)) {
- $checkedValue = explode(CRM_Core_DAO::VALUE_SEPARATOR, $value);
+ // Values may be "array strings" or actual arrays. Handle both.
+ if (is_array($value) && count($value)) {
+ CRM_Utils_Array::formatArrayKeys($value);
+ $checkedValue = $value;
+ }
+ else {
+ $checkedValue = explode(CRM_Core_DAO::VALUE_SEPARATOR, substr($value, 1, -1));
+ }
foreach ($checkedValue as $val) {
if ($val) {
$defaults[$elementName][$val] = $val;