#56143 by chx: Non multiple form elements also set to array

4.7.x
Neil Drumm 2006-03-29 23:29:41 +00:00
parent 4797222c13
commit 6ad023451a
1 changed files with 7 additions and 2 deletions

View File

@ -339,7 +339,12 @@ function form_builder($form_id, $form) {
$form['#value'] = !empty($edit) ? $form['#return_value'] : 0;
break;
case 'select':
$form['#value'] = isset($edit) ? $edit : array();
if (isset($edit)) {
$form['#value'] = $edit;
}
elseif (isset($form['#multiple']) && $form['#multiple']) {
$form['#value'] = array();
}
break;
case 'textfield':
if (isset($edit)) {
@ -874,7 +879,7 @@ function theme_button($element) {
else {
$element['#attributes']['class'] = 'form-'. $element['#button_type'];
}
return '<input type="submit" '. (empty($element['#name']) ? '' : 'name="'. $element['#name'] .'" ') .'value="'. check_plain($element['#value']) .'" '. drupal_attributes($element['#attributes']) ." />\n";
}