From 13984a7394ec27a2e99b6c7437469f663a331cc3 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 14 Dec 2009 20:18:56 +0000 Subject: - Patch #639466 by yched: fixed hook_options_list() and XSS filtering, and added more tests. --- modules/taxonomy/taxonomy.module | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'modules/taxonomy/taxonomy.module') diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index e21728c9d..f17aa1b4e 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -983,16 +983,6 @@ function taxonomy_field_info() { /** * Implements hook_field_widget_info(). - * - * We need custom handling of multiple values because we need - * to combine them into a options list rather than display - * cardinality elements. We will use the field module's default - * handling for default values. - * - * Callbacks can be omitted if default handing is used. - * They're included here just so this module can be used - * as an example for custom modules that might do things - * differently. */ function taxonomy_field_widget_info() { return array( @@ -1018,6 +1008,13 @@ function taxonomy_field_widget_info_alter(&$info) { $info['options_buttons']['field types'][] = 'taxonomy_term'; } +/** + * Implements hook_options_list(). + */ +function taxonomy_options_list($field) { + return taxonomy_allowed_values($field); +} + /** * Implements hook_field_schema(). */ @@ -1122,12 +1119,12 @@ function taxonomy_field_formatter($object_type, $object, $field, $instance, $lan } /** - * Create an array of the allowed values for this field. + * Returns the set of valid terms for a taxonomy field. * - * Call the field's allowed_values function to retrieve the allowed - * values array. - * - * @see _taxonomy_term_select() + * @param $field + * The field definition. + * @return + * The array of valid terms for this field, keyed by term id. */ function taxonomy_allowed_values($field) { $options = array(); -- cgit v1.2.3