summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/form.inc3
-rw-r--r--modules/taxonomy/taxonomy.module4
2 files changed, 6 insertions, 1 deletions
diff --git a/includes/form.inc b/includes/form.inc
index d0a72c9b9..76ab0000f 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -890,6 +890,9 @@ function form_select_options($element, $choices = NULL) {
$options .= form_select_options($element, $choice);
$options .= '</optgroup>';
}
+ elseif (is_object($choice)) {
+ $options .= form_select_options($element, $choice->option);
+ }
else {
$key = (string)$key;
if ($value_valid && ($element['#value'] == $key || ($value_is_array && in_array($key, $element['#value'])))) {
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index e75b9f08c..86795cae5 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -1101,7 +1101,9 @@ function _taxonomy_term_select($title, $name, $value, $vocabulary_id, $descripti
if ($tree) {
foreach ($tree as $term) {
if (!in_array($term->tid, $exclude)) {
- $options[$term->tid] = str_repeat('-', $term->depth) . $term->name;
+ $choice = new stdClass();
+ $choice->option = array($term->tid => str_repeat('-', $term->depth) . $term->name);
+ $options[] = $choice;
}
}
if (!$blank && !$value) {