From c4962c975688e2790d3a9c9ceab10b97d1d4f4dc Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Mon, 4 Jan 2010 18:03:12 +0000 Subject: [PATCH] #664920 by catch and chx: Change 'taxonomy_term()' field to 'taxonomy_term_reference()'. --- modules/rdf/rdf.module | 2 +- modules/taxonomy/taxonomy.module | 30 +++++++++++++++--------------- modules/taxonomy/taxonomy.test | 10 +++++----- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/modules/rdf/rdf.module b/modules/rdf/rdf.module index 82216b993a7..c25ae9323e2 100644 --- a/modules/rdf/rdf.module +++ b/modules/rdf/rdf.module @@ -580,7 +580,7 @@ function rdf_field_attach_view_alter(&$output, $context) { // Append term mappings on displayed taxonomy links. foreach (element_children($output) as $field_name) { $element = &$output[$field_name]; - if ($element['#field_type'] == 'taxonomy_term' && $element['#formatter'] == 'taxonomy_term_link') { + if ($element['#field_type'] == 'taxonomy_term_reference' && $element['#formatter'] == 'taxonomy_term_reference_link') { foreach ($element['#items'] as $delta => $item) { $term = $item['taxonomy_term']; if (!empty($term->rdf_mapping['rdftype'])) { diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index d7bc3252a73..f1c161f71a4 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -424,7 +424,7 @@ function taxonomy_check_vocabulary_hierarchy($vocabulary, $changed_term) { function taxonomy_vocabulary_create_field($vocabulary) { $field = array( 'field_name' => 'taxonomy_' . $vocabulary->machine_name, - 'type' => 'taxonomy_term', + 'type' => 'taxonomy_term_reference', // Set cardinality to unlimited so that select // and autocomplete widgets behave as normal. 'cardinality' => FIELD_CARDINALITY_UNLIMITED, @@ -953,11 +953,11 @@ function taxonomy_implode_tags($tags, $vid = NULL) { */ function taxonomy_field_info() { return array( - 'taxonomy_term' => array( - 'label' => t('Taxonomy term'), + 'taxonomy_term_reference' => array( + 'label' => t('Term reference'), 'description' => t('This field stores a reference to a taxonomy term.'), 'default_widget' => 'options_select', - 'default_formatter' => 'taxonomy_term_link', + 'default_formatter' => 'taxonomy_term_reference_link', 'settings' => array( 'allowed_values' => array( array( @@ -977,7 +977,7 @@ function taxonomy_field_widget_info() { return array( 'taxonomy_autocomplete' => array( 'label' => t('Autocomplete term widget (tagging)'), - 'field types' => array('taxonomy_term'), + 'field types' => array('taxonomy_term_reference'), 'settings' => array( 'size' => 60, 'autocomplete_path' => 'taxonomy/autocomplete', @@ -993,8 +993,8 @@ function taxonomy_field_widget_info() { * Implements hook_field_widget_info_alter(). */ function taxonomy_field_widget_info_alter(&$info) { - $info['options_select']['field types'][] = 'taxonomy_term'; - $info['options_buttons']['field types'][] = 'taxonomy_term'; + $info['options_select']['field types'][] = 'taxonomy_term_reference'; + $info['options_buttons']['field types'][] = 'taxonomy_term_reference'; } /** @@ -1036,7 +1036,7 @@ function taxonomy_field_validate($obj_type, $object, $field, $instance, $langcod if (!empty($item['tid'])) { if (!isset($allowed_values[$item['tid']])) { $errors[$field['field_name']][$langcode][$delta][] = array( - 'error' => 'taxonomy_term_illegal_value', + 'error' => 'taxonomy_term_reference_illegal_value', 'message' => t('%name: illegal value.', array('%name' => t($instance['label']))), ); } @@ -1059,13 +1059,13 @@ function taxonomy_field_is_empty($item, $field) { */ function taxonomy_field_formatter_info() { return array( - 'taxonomy_term_link' => array( + 'taxonomy_term_reference_link' => array( 'label' => t('Link'), - 'field types' => array('taxonomy_term'), + 'field types' => array('taxonomy_term_reference'), ), - 'taxonomy_term_plain' => array( + 'taxonomy_term_reference_plain' => array( 'label' => t('Plain text'), - 'field types' => array('taxonomy_term'), + 'field types' => array('taxonomy_term_reference'), ), ); } @@ -1077,7 +1077,7 @@ function taxonomy_field_formatter_view($object_type, $object, $field, $instance, $element = array(); switch ($display['type']) { - case 'taxonomy_term_link': + case 'taxonomy_term_reference_link': foreach ($items as $delta => $item) { $term = $item['taxonomy_term']; $element[$delta] = array( @@ -1088,7 +1088,7 @@ function taxonomy_field_formatter_view($object_type, $object, $field, $instance, } break; - case 'taxonomy_term_plain': + case 'taxonomy_term_reference_plain': foreach ($items as $delta => $item) { $term = $item['taxonomy_term']; $element[$delta] = array( @@ -1173,7 +1173,7 @@ function _taxonomy_clean_field_cache($term) { } // Load info for all taxonomy term fields. - $fields = field_read_fields(array('type' => 'taxonomy_term')); + $fields = field_read_fields(array('type' => 'taxonomy_term_reference')); foreach ($fields as $field_name => $field) { // Assemble an array of vocabulary IDs that are used in this field. diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test index 025e902f3f7..f44db545d22 100644 --- a/modules/taxonomy/taxonomy.test +++ b/modules/taxonomy/taxonomy.test @@ -332,7 +332,7 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase { ), 'display' => array( 'full' => array( - 'type' => 'taxonomy_term_link', + 'type' => 'taxonomy_term_reference_link', ), ), ); @@ -703,7 +703,7 @@ class TaxonomyTermFieldTestCase extends TaxonomyWebTestCase { public static function getInfo() { return array( - 'name' => 'Taxonomy term field', + 'name' => 'Taxonomy term reference field', 'description' => 'Test the creation of term fields.', 'group' => 'Taxonomy', ); @@ -726,7 +726,7 @@ class TaxonomyTermFieldTestCase extends TaxonomyWebTestCase { // Create a field with settings to validate. $this->field = array( 'field_name' => $this->field_name, - 'type' => 'taxonomy_term', + 'type' => 'taxonomy_term_reference', 'settings' => array( 'allowed_values' => array( array( @@ -746,7 +746,7 @@ class TaxonomyTermFieldTestCase extends TaxonomyWebTestCase { ), 'display' => array( 'full' => array( - 'type' => 'taxonomy_term_link', + 'type' => 'taxonomy_term_reference_link', ), ), ); @@ -786,7 +786,7 @@ class TaxonomyTermFieldTestCase extends TaxonomyWebTestCase { $this->field_name = drupal_strtolower($this->randomName()); $this->field = array( 'field_name' => $this->field_name, - 'type' => 'taxonomy_term', + 'type' => 'taxonomy_term_reference', 'settings' => array( 'allowed_values' => array( array(