diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index 4a2b16714fd1..5e80c4dd251c 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -1264,6 +1264,11 @@ public static function setDefaults(&$groupTree, &$defaults, $viewMode = FALSE, $ } } else { + if ($field['html_type'] === 'Autocomplete-Select') { + $checkedValue = array_filter((array) \CRM_Utils_Array::explodePadded($value)); + $defaults[$elementName] = implode(',', $checkedValue); + continue; + } // Values may be "array strings" or actual arrays. Handle both. if (is_array($value) && count($value)) { CRM_Utils_Array::formatArrayKeys($value); @@ -1274,7 +1279,7 @@ public static function setDefaults(&$groupTree, &$defaults, $viewMode = FALSE, $ } foreach ($customOption as $val) { if (in_array($val['value'], $checkedValue)) { - if ($field['html_type'] == 'CheckBox') { + if ($field['html_type'] === 'CheckBox') { $defaults[$elementName][$val['value']] = 1; } else {