function content_multigroup_fix_multivalue_fields in Content Construction Kit (CCK) 6.3
Fix the value for fields that deal with multiple values themselves.
1 string reference to 'content_multigroup_fix_multivalue_fields'
- content_multigroup_group_form in modules/
content_multigroup/ content_multigroup.node_form.inc - Create a new delta value for the group.
File
- modules/
content_multigroup/ content_multigroup.node_form.inc, line 676 - Implementation of node edit functions for content multigroup.
Code
function content_multigroup_fix_multivalue_fields($element, &$form_state) {
$field_name = $element['#field_name'];
$delta = $element['#delta'];
if (isset($form_state['values'][$field_name][$delta][0]) && is_array($form_state['values'][$field_name][$delta][0])) {
$value = array_merge($form_state['values'][$field_name][$delta][0], array(
'_remove' => $element['#removed'],
));
}
else {
$value = array(
'_remove' => $element['#removed'],
);
}
form_set_value($element, $value, $form_state);
}