diff --git a/modules/taxonomy/views_handler_filter_term_node_tid.inc b/modules/taxonomy/views_handler_filter_term_node_tid.inc index 5ca6d18..5406b5d 100644 --- a/modules/taxonomy/views_handler_filter_term_node_tid.inc +++ b/modules/taxonomy/views_handler_filter_term_node_tid.inc @@ -130,21 +130,20 @@ class views_handler_filter_term_node_tid extends views_handler_filter_many_to_on } if ($this->options['type'] == 'textfield') { - $default = ''; + $term_labels = array(); if ($this->value) { $result = taxonomy_term_load_multiple($this->value); foreach ($result as $entity_term) { - if ($default) { - $default .= ', '; + if ($entity_label = entity_label('taxonomy_term', $entity_term)) { + $term_labels[] = $entity_label; } - $default .= entity_label('taxonomy_term', $entity_term); } } $form['value'] = array( '#title' => $this->options['limit'] ? t('Select terms from vocabulary @voc', array('@voc' => $vocabulary->name)) : t('Select terms'), '#type' => 'textfield', - '#default_value' => $default, + '#default_value' => $term_labels ? implode(', ', $term_labels) : '', ); if ($this->options['limit']) { @@ -194,7 +193,9 @@ class views_handler_filter_term_node_tid extends views_handler_filter_many_to_on } $entities = taxonomy_term_load_multiple($tids); foreach ($entities as $entity_term) { - $options[$entity_term->tid] = entity_label('taxonomy_term', $entity_term); + if ($entity_label = entity_label('taxonomy_term', $entity_term)) { + $options[$entity_term->tid] = $entity_label; + } } }