Commit 6adef966 authored by Matthias Hutterer's avatar Matthias Hutterer
Browse files

implementation of default_value for 4.7

parent 66c70de8
......@@ -171,7 +171,7 @@ function email_widget($op, &$node, $field, &$node_field) {
$form[$field['field_name']][$delta]['email'] = array(
'#type' => 'textfield',
'#title' => '',
'#default_value' => isset($node_field[$delta]['email']) ? $node_field[$delta]['email'] : '',
'#default_value' => isset($node_field[$delta]['email']) ? $node_field[$delta]['email'] : $field['widget']['default_value'][$delta]['email'],
'#required' => $field['required'] ? $field['required'] : FALSE,
'#maxlength' => 255,
'#size' => isset($field['widget']['size']) ? $field['widget']['size'] : 60,
......@@ -183,7 +183,7 @@ function email_widget($op, &$node, $field, &$node_field) {
$form[$field['field_name']][0]['email'] = array(
'#type' => 'textfield',
'#title' => $field['widget']['label'],
'#default_value' => isset($node_field[0]['email']) ? $node_field[0]['email'] : '',
'#default_value' => isset($node_field[0]['email']) ? $node_field[0]['email'] : $field['widget']['default_value'][0]['email'],
'#required' => $field['required'] ? $field['required'] : FALSE,
'#maxlength' => 255,
'#size' => isset($field['widget']['size']) ? $field['widget']['size'] : 60,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment