function node_field_file_form_alter in Node Field 7.2
Implements hook_form_alter().
File
- modules/
node_field_file/ node_field_file.module, line 86
Code
function node_field_file_form_alter($form, $form_state, $form_id) {
if ($form_id == 'node_field_group_node_view_form' && isset($form_state['values'])) {
$keys = array_keys($form_state['values']);
foreach ($keys as $key) {
if (preg_match('|^node_fields_(\\d*)_remove_button$|im', $key, $matches)) {
$field = node_field_load_node_field($matches[1]);
$field['value'] = '';
node_field_update_node_field($field);
}
}
}
}