'is_multiple'
);
- if ($params['is_multiple'] != $isMultiple) {
+ // dev/core#227 Fix issue where is_multiple in params maybe an empty string if checkbox is not rendered on the form.
+ $paramsIsMultiple = empty($params['is_multiple']) ? 0 : 1;
+ if ($paramsIsMultiple != $isMultiple) {
$tableNameNeedingIndexUpdate = CRM_Core_DAO::getFieldValue(
'CRM_Core_DAO_CustomGroup',
$params['id'],
* @param bool $is_active
* Value we want to set the is_active field.
*
- * @return Object
- * DAO object on success, null otherwise
+ * @return bool
+ * true if we found and updated the object, else false
*/
public static function setIsActive($id, $is_active) {
// reset the cache
$in = "'$entityType'";
}
+ $params = array();
+ $sqlParamKey = 1;
if (!empty($subTypes)) {
foreach ($subTypes as $key => $subType) {
$subTypeClauses[] = self::whereListHas("civicrm_custom_group.extends_entity_column_value", self::validateSubTypeByEntity($entityType, $subType));
AND $subTypeClause
";
if ($subName) {
- $strWhere .= " AND civicrm_custom_group.extends_entity_column_id = {$subName} ";
+ $strWhere .= " AND civicrm_custom_group.extends_entity_column_id = %{$sqlParamKey}";
+ $params[$sqlParamKey] = array($subName, 'String');
+ $sqlParamKey = $sqlParamKey + 1;
}
}
else {
}
}
- $params = array();
if ($groupID > 0) {
// since we want a specific group id we add it to the where clause
- $strWhere .= " AND civicrm_custom_group.id = %1";
- $params[1] = array($groupID, 'Integer');
+ $strWhere .= " AND civicrm_custom_group.id = %{$sqlParamKey}";
+ $params[$sqlParamKey] = array($groupID, 'Integer');
}
elseif (!$groupID) {
// since groupID is false we need to show all Inline groups
switch ($field['html_type']) {
case 'Multi-Select':
- case 'AdvMulti-Select':
case 'CheckBox':
$defaults[$elementName] = array();
$customOption = CRM_Core_BAO_CustomOption::getCustomOption($field['id'], $inactiveNeeded);
//added Multi-Select option in the below if-statement
if ($field['html_type'] == 'CheckBox' ||
$field['html_type'] == 'Radio' ||
- $field['html_type'] == 'AdvMulti-Select' ||
$field['html_type'] == 'Multi-Select'
) {
$groupTree[$groupID]['fields'][$fieldId]['customValue']['data'] = 'NULL';
}
break;
- //added for Advanced Multi-Select
-
- case 'AdvMulti-Select':
- //added for Multi-Select
case 'Multi-Select':
if (!empty($v)) {
$groupTree[$groupID]['fields'][$fieldId]['customValue']['data'] = CRM_Core_DAO::VALUE_SEPARATOR
$htmlType = array(
'CheckBox',
'Multi-Select',
- 'AdvMulti-Select',
'Select',
'Radio',
);
$valid = CRM_Core_BAO_CustomValue::typecheck($field['data_type'], $value);
}
if ($field['html_type'] == 'CheckBox' ||
- $field['html_type'] == 'AdvMulti-Select' ||
$field['html_type'] == 'Multi-Select'
) {
$value = str_replace("|", ",", $value);