if (isset($params['group_type'])) {
if (is_array($params['group_type'])) {
$params['group_type'] = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
- array_keys($params['group_type'])
+ $params['group_type']
) . CRM_Core_DAO::VALUE_SEPARATOR;
}
}
}
$params['is_reserved'] = CRM_Utils_Array::value('is_reserved', $params, FALSE);
- $params['group_type'] = CRM_Utils_Array::value('group_type', $params, array());
+
+ $groupTypeIds = array();
+ $groupType = CRM_Utils_Array::value('group_type', $params);
+ if (is_array($groupType)) {
+ foreach ($groupType as $type => $selected) {
+ if ($selected) {
+ $groupTypeIds[] = $type;
+ }
+ }
+ }
+ $params['group_type'] = $groupTypeIds;
$customFields = CRM_Core_BAO_CustomField::getFields('Group');
$params['custom'] = CRM_Core_BAO_CustomField::postProcess($params,