diff --git a/core/includes/form.inc b/core/includes/form.inc index 02e36fb..537eff8 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -79,8 +79,8 @@ function template_preprocess_select(&$variables) { * and is not intended to be passed in to the initial function call. * * @return array - * A structured array of options and optgroups for use in a select form - * element. + * A structured, possibly nested, array of options and optgroups for use in a + * select form element. * - label: A translated string whose value is the text of a single HTML * option element, or the label attribute for an optgroup. * - options: Optional, array of options for an optgroup. @@ -113,8 +113,7 @@ function form_select_options($element, $choices = NULL) { ]; } elseif (is_object($choice) && isset($choice->option)) { - $option = form_select_options($element, $choice->option); - $options[] = reset($option); + $options = array_merge($options, form_select_options($element, $choice->option)); } else { $option = [];