From 58db2b27a40bc6446d040c7476fbe742fb1852fe Mon Sep 17 00:00:00 2001 From: Neil Drumm <drumm@3064.no-reply.drupal.org> Date: Tue, 16 May 2006 01:55:57 +0000 Subject: [PATCH] #62829 by Jaza, Multi selects in hook_settings are broken --- includes/form.inc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/includes/form.inc b/includes/form.inc index 35333e5fec3c..310270112345 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -344,11 +344,16 @@ function form_builder($form_id, $form) { $form['#value'] = !empty($edit) ? $form['#return_value'] : 0; break; case 'select': - if (isset($edit)) { - $form['#value'] = $edit; + if (isset($form['#multiple']) && $form['#multiple']) { + if (isset($edit) && is_array($edit)) { + $form['#value'] = drupal_map_assoc($edit); + } + else { + $form['#value'] = array(); + } } - elseif (isset($form['#multiple']) && $form['#multiple']) { - $form['#value'] = array(); + elseif (isset($edit)) { + $form['#value'] = $edit; } break; case 'textfield': -- GitLab