summaryrefslogtreecommitdiff
path: root/modules/taxonomy/taxonomy.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-12-14 20:18:56 +0000
committerDries Buytaert <dries@buytaert.net>2009-12-14 20:18:56 +0000
commit13984a7394ec27a2e99b6c7437469f663a331cc3 (patch)
tree5ed140ce52e8156c40e50373b708ba8de724f680 /modules/taxonomy/taxonomy.module
parent7e6fdd8540f0bddb68cc303ae769f043a6aea16d (diff)
downloadbrdo-13984a7394ec27a2e99b6c7437469f663a331cc3.tar.gz
brdo-13984a7394ec27a2e99b6c7437469f663a331cc3.tar.bz2
- Patch #639466 by yched: fixed hook_options_list() and XSS filtering, and added more tests.
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r--modules/taxonomy/taxonomy.module27
1 files changed, 12 insertions, 15 deletions
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(
@@ -1019,6 +1009,13 @@ function taxonomy_field_widget_info_alter(&$info) {
}
/**
+ * Implements hook_options_list().
+ */
+function taxonomy_options_list($field) {
+ return taxonomy_allowed_values($field);
+}
+
+/**
* Implements hook_field_schema().
*/
function taxonomy_field_schema($field) {
@@ -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();