--- includes\form.inc 2008-12-03 17:32:22.000000000 +0100
+++ includes\form.new.inc 2008-12-08 15:07:35.527814000 +0100
@@ -1429,7 +1429,10 @@
$value_is_array = is_array($element['#value']);
$options = '';
foreach ($choices as $key => $choice) {
- if (is_array($choice)) {
+ if (!is_array($choice)) {
+ $choice = array('#value' => $choice);
+ }
+ if (isset($choice['#options']) && is_array($choice['#options'])) {
$options .= '';
@@ -1437,7 +1440,7 @@
elseif (is_object($choice)) {
$options .= form_select_options($element, $choice->option);
}
- else {
+ else {
$key = (string)$key;
if ($value_valid && (!$value_is_array && (string)$element['#value'] === $key || ($value_is_array && in_array($key, $element['#value'])))) {
$selected = ' selected="selected"';
@@ -1445,7 +1448,8 @@
else {
$selected = '';
}
- $options .= '';
+ $attributes = (isset($choice['#attributes']) ? drupal_attributes($choice['#attributes']) : '');
+ $options .= '';
}
}
return $options;