diff --git a/core/modules/forum/src/Tests/ForumTest.php b/core/modules/forum/src/Tests/ForumTest.php index 6217835..30208c4 100644 --- a/core/modules/forum/src/Tests/ForumTest.php +++ b/core/modules/forum/src/Tests/ForumTest.php @@ -387,7 +387,7 @@ function createForum($type, $parent = 0) { ); // Verify forum. - $term = db_query("SELECT * FROM {taxonomy_term_data} t WHERE t.vid = :vid AND t.name = :name AND t.description__value = :desc", array(':vid' => \Drupal::config('forum.settings')->get('vocabulary'), ':name' => $name, ':desc' => $description))->fetchAssoc(); + $term = db_query("SELECT * FROM {taxonomy_term_field_data} t WHERE t.vid = :vid AND t.name = :name AND t.description__value = :desc AND t.default_langcode = 1", array(':vid' => \Drupal::config('forum.settings')->get('vocabulary'), ':name' => $name, ':desc' => $description))->fetchAssoc(); $this->assertTrue(!empty($term), 'The ' . $type . ' exists in the database'); // Verify forum hierarchy. diff --git a/core/modules/node/src/Tests/NodeAccessBaseTableTest.php b/core/modules/node/src/Tests/NodeAccessBaseTableTest.php index a590f28..26bf2fd 100644 --- a/core/modules/node/src/Tests/NodeAccessBaseTableTest.php +++ b/core/modules/node/src/Tests/NodeAccessBaseTableTest.php @@ -95,8 +95,8 @@ function testNodeAccessBasic() { $this->nodesByUser[$this->webUser->id()][$nid] = $is_private; } } - $this->publicTid = db_query('SELECT tid FROM {taxonomy_term_data} WHERE name = :name', array(':name' => 'public'))->fetchField(); - $this->privateTid = db_query('SELECT tid FROM {taxonomy_term_data} WHERE name = :name', array(':name' => 'private'))->fetchField(); + $this->publicTid = db_query('SELECT tid FROM {taxonomy_term_field_data} WHERE name = :name AND default_langcode = 1', array(':name' => 'public'))->fetchField(); + $this->privateTid = db_query('SELECT tid FROM {taxonomy_term_field_data} WHERE name = :name AND default_langcode = 1', array(':name' => 'private'))->fetchField(); $this->assertTrue($this->publicTid, 'Public tid was found'); $this->assertTrue($this->privateTid, 'Private tid was found'); foreach ($simple_users as $this->webUser) { diff --git a/core/modules/path/src/Tests/PathTaxonomyTermTest.php b/core/modules/path/src/Tests/PathTaxonomyTermTest.php index 6c9d0e6..8709d69 100644 --- a/core/modules/path/src/Tests/PathTaxonomyTermTest.php +++ b/core/modules/path/src/Tests/PathTaxonomyTermTest.php @@ -55,7 +55,7 @@ function testTermAlias() { 'path[0][alias]' => $this->randomName(), ); $this->drupalPostForm('admin/structure/taxonomy/manage/' . $vocabulary->id() . '/add', $edit, t('Save')); - $tid = db_query("SELECT tid FROM {taxonomy_term_data} WHERE name = :name", array(':name' => $edit['name[0][value]']))->fetchField(); + $tid = db_query("SELECT tid FROM {taxonomy_term_field_data} WHERE name = :name AND default_langcode = 1", array(':name' => $edit['name[0][value]']))->fetchField(); // Confirm that the alias works. $this->drupalGet($edit['path[0][alias]']); diff --git a/core/modules/taxonomy/src/Entity/Term.php b/core/modules/taxonomy/src/Entity/Term.php index 8796e83..6557171 100644 --- a/core/modules/taxonomy/src/Entity/Term.php +++ b/core/modules/taxonomy/src/Entity/Term.php @@ -31,6 +31,7 @@ * "translation" = "Drupal\taxonomy\TermTranslationHandler" * }, * base_table = "taxonomy_term_data", + * data_table = "taxonomy_term_field_data", * uri_callback = "taxonomy_term_uri", * fieldable = TRUE, * translatable = TRUE, @@ -122,6 +123,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields['name'] = FieldDefinition::create('string') ->setLabel(t('Name')) ->setDescription(t('The term name.')) + ->setTranslatable(TRUE) ->setRequired(TRUE) ->setSetting('max_length', 255) ->setDisplayOptions('view', array( @@ -138,6 +140,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields['description'] = FieldDefinition::create('text_long') ->setLabel(t('Description')) ->setDescription(t('A description of the term.')) + ->setTranslatable(TRUE) ->setSetting('text_processing', 1) ->setDisplayOptions('view', array( 'label' => 'hidden', diff --git a/core/modules/taxonomy/src/Plugin/views/argument/IndexTid.php b/core/modules/taxonomy/src/Plugin/views/argument/IndexTid.php index 59b4332..a6f734c 100644 --- a/core/modules/taxonomy/src/Plugin/views/argument/IndexTid.php +++ b/core/modules/taxonomy/src/Plugin/views/argument/IndexTid.php @@ -21,9 +21,10 @@ class IndexTid extends ManyToOne { public function titleQuery() { $titles = array(); - $result = db_select('taxonomy_term_data', 'td') + $result = db_select('taxonomy_term_field_data', 'td') ->fields('td', array('name')) ->condition('td.tid', $this->value) + ->condition('td.default_langcode', 1) ->execute(); foreach ($result as $term_record) { $titles[] = String::checkPlain($term_record->name); diff --git a/core/modules/taxonomy/src/Plugin/views/field/Language.php b/core/modules/taxonomy/src/Plugin/views/field/Language.php index 13e3d23..f95f492 100644 --- a/core/modules/taxonomy/src/Plugin/views/field/Language.php +++ b/core/modules/taxonomy/src/Plugin/views/field/Language.php @@ -21,7 +21,7 @@ class Language extends Taxonomy { */ public function render(ResultRow $values) { $value = $this->getValue($values); - $language = language_load($value); + $language = \Drupal::languageManager()->getLanguage($value); $value = $language ? $language->name : ''; return $this->renderLink($this->sanitizeValue($value), $values); diff --git a/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php b/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php index 90e8225..77018ce 100644 --- a/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php +++ b/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php @@ -102,13 +102,14 @@ public function preRender(&$values) { } if ($nids) { - $query = db_select('taxonomy_term_data', 'td'); + $query = db_select('taxonomy_term_field_data', 'td'); $query->innerJoin('taxonomy_index', 'tn', 'td.tid = tn.tid'); $query->fields('td'); $query->addField('tn', 'nid', 'node_nid'); $query->orderby('td.weight'); $query->orderby('td.name'); $query->condition('tn.nid', $nids); + $query->condition('td.default_langcode', 1); $query->addTag('term_access'); $vocabs = array_filter($this->options['vids']); if (!empty($this->options['limit']) && !empty($vocabs)) { diff --git a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php index 2c708ea..39819fc 100644 --- a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php +++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php @@ -107,9 +107,10 @@ protected function valueForm(&$form, &$form_state) { if ($this->options['type'] == 'textfield') { $default = ''; if ($this->value) { - $result = db_select('taxonomy_term_data', 'td') + $result = db_select('taxonomy_term_field_data', 'td') ->fields('td') ->condition('td.tid', $this->value) + ->condition('td.default_langcode', 1) ->execute(); foreach ($result as $term_record) { if ($default) { @@ -145,7 +146,7 @@ protected function valueForm(&$form, &$form_state) { } else { $options = array(); - $query = db_select('taxonomy_term_data', 'td'); + $query = db_select('taxonomy_term_field_data', 'td'); $query->fields('td'); // @todo Sorting on vocabulary properties http://drupal.org/node/1821274 $query->orderby('td.weight'); @@ -154,6 +155,7 @@ protected function valueForm(&$form, &$form_state) { if ($this->options['limit']) { $query->condition('td.vid', $vocabulary->id()); } + $query->condition('td.default_langcode', 1); $result = $query->execute(); foreach ($result as $term_record) { $options[$term_record->tid] = $term_record->name; @@ -310,10 +312,11 @@ function validate_term_strings(&$form, $values) { return FALSE; } - $query = db_select('taxonomy_term_data', 'td'); + $query = db_select('taxonomy_term_field_data', 'td'); $query->fields('td'); $query->condition('td.name', $names); $query->condition('td.vid', $this->options['vid']); + $query->condition('td.default_langcode', 1); $query->addTag('term_access'); $result = $query->execute(); foreach ($result as $term_record) { @@ -353,9 +356,10 @@ public function adminSummary() { if ($this->value) { $this->value = array_filter($this->value); - $result = db_select('taxonomy_term_data', 'td') + $result = db_select('taxonomy_term_field_data', 'td') ->fields('td') ->condition('td.tid', $this->value) + ->condition('td.default_langcode', 1) ->execute(); foreach ($result as $term_record) { $this->value_options[$term_record->tid] = $term_record->name; diff --git a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php index da0a61d..a0f3857 100644 --- a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php +++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php @@ -50,7 +50,7 @@ public function query() { return; } elseif (count($this->value) == 1) { - // Somethis $this->value is an array with a single element so convert it. + // Sometimes $this->value is an array with a single element so convert it. if (is_array($this->value)) { $this->value = current($this->value); } diff --git a/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php b/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php index c720ee9..c32ff95 100644 --- a/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php +++ b/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php @@ -68,7 +68,7 @@ public function query() { $this->ensureMyTable(); $def = $this->definition; - $def['table'] = 'taxonomy_term_data'; + $def['table'] = 'taxonomy_term_field_data'; if (!array_filter($this->options['vids'])) { $taxonomy_index = $this->query->addTable('taxonomy_index', $this->relationship); @@ -85,9 +85,10 @@ public function query() { $def['type'] = empty($this->options['required']) ? 'LEFT' : 'INNER'; $def['adjusted'] = TRUE; - $query = db_select('taxonomy_term_data', 'td'); + $query = db_select('taxonomy_term_field_data', 'td'); $query->addJoin($def['type'], 'taxonomy_index', 'tn', 'tn.tid = td.tid'); $query->condition('td.vid', array_filter($this->options['vids'])); + $query->condition('td.default_langcode', 1); $query->addTag('term_access'); $query->fields('td'); $query->fields('tn', array('nid')); @@ -99,7 +100,7 @@ public function query() { // use a short alias for this: $alias = $def['table'] . '_' . $this->table; - $this->alias = $this->query->addRelationship($alias, $join, 'taxonomy_term_data', $this->relationship); + $this->alias = $this->query->addRelationship($alias, $join, 'taxonomy_term_field_data', $this->relationship); } } diff --git a/core/modules/taxonomy/src/Plugin/views/wizard/TaxonomyTerm.php b/core/modules/taxonomy/src/Plugin/views/wizard/TaxonomyTerm.php index 1c34511..480dc26 100644 --- a/core/modules/taxonomy/src/Plugin/views/wizard/TaxonomyTerm.php +++ b/core/modules/taxonomy/src/Plugin/views/wizard/TaxonomyTerm.php @@ -49,7 +49,7 @@ protected function defaultDisplayOptions() { /* Field: Taxonomy: Term */ $display_options['fields']['name']['id'] = 'name'; - $display_options['fields']['name']['table'] = 'taxonomy_term_data'; + $display_options['fields']['name']['table'] = 'taxonomy_term_field_data'; $display_options['fields']['name']['field'] = 'name'; $display_options['fields']['name']['provider'] = 'taxonomy'; $display_options['fields']['name']['label'] = ''; diff --git a/core/modules/taxonomy/src/TermStorage.php b/core/modules/taxonomy/src/TermStorage.php index 381b0ab..e0908ae 100644 --- a/core/modules/taxonomy/src/TermStorage.php +++ b/core/modules/taxonomy/src/TermStorage.php @@ -87,10 +87,11 @@ public function updateTermHierarchy(EntityInterface $term) { * {@inheritdoc} */ public function loadParents($tid) { - $query = $this->database->select('taxonomy_term_data', 't'); + $query = $this->database->select('taxonomy_term_field_data', 't'); $query->join('taxonomy_term_hierarchy', 'h', 'h.parent = t.tid'); $query->addField('t', 'tid'); $query->condition('h.tid', $tid); + $query->condition('t.default_langcode', 1); $query->addTag('term_access'); $query->orderBy('t.weight'); $query->orderBy('t.name'); @@ -101,13 +102,14 @@ public function loadParents($tid) { * {@inheritdoc} */ public function loadChildren($tid, $vid = NULL) { - $query = $this->database->select('taxonomy_term_data', 't'); + $query = $this->database->select('taxonomy_term_field_data', 't'); $query->join('taxonomy_term_hierarchy', 'h', 'h.tid = t.tid'); $query->addField('t', 'tid'); $query->condition('h.parent', $tid); if ($vid) { $query->condition('t.vid', $vid); } + $query->condition('t.default_langcode', 1); $query->addTag('term_access'); $query->orderBy('t.weight'); $query->orderBy('t.name'); @@ -118,13 +120,14 @@ public function loadChildren($tid, $vid = NULL) { * {@inheritdoc} */ public function loadTree($vid) { - $query = $this->database->select('taxonomy_term_data', 't'); + $query = $this->database->select('taxonomy_term_field_data', 't'); $query->join('taxonomy_term_hierarchy', 'h', 'h.tid = t.tid'); return $query ->addTag('term_access') ->fields('t') ->fields('h', array('parent')) ->condition('t.vid', $vid) + ->condition('t.default_langcode', 1) ->orderBy('t.weight') ->orderBy('t.name') ->execute(); @@ -146,7 +149,7 @@ public function nodeCount($vid) { * {@inheritdoc} */ public function resetWeights($vid) { - $this->database->update('taxonomy_term_data') + $this->database->update('taxonomy_term_field_data') ->fields(array('weight' => 0)) ->condition('vid', $vid) ->execute(); @@ -160,12 +163,12 @@ public function getSchema() { // Marking the respective fields as NOT NULL makes the indexes more // performant. - $schema['taxonomy_term_data']['fields']['weight']['not null'] = TRUE; - $schema['taxonomy_term_data']['fields']['name']['not null'] = TRUE; + $schema['taxonomy_term_field_data']['fields']['weight']['not null'] = TRUE; + $schema['taxonomy_term_field_data']['fields']['name']['not null'] = TRUE; unset($schema['taxonomy_term_data']['indexes']['field__vid']); unset($schema['taxonomy_term_data']['indexes']['field__description__format']); - $schema['taxonomy_term_data']['indexes'] += array( + $schema['taxonomy_term_field_data']['indexes'] += array( 'taxonomy_term__tree' => array('vid', 'weight', 'name'), 'taxonomy_term__vid_name' => array('vid', 'name'), 'taxonomy_term__name' => array('name'), diff --git a/core/modules/taxonomy/src/Tests/Views/RelationshipRepresentativeNode.php b/core/modules/taxonomy/src/Tests/Views/RelationshipRepresentativeNode.php index 1d754f0..4406ea0 100644 --- a/core/modules/taxonomy/src/Tests/Views/RelationshipRepresentativeNode.php +++ b/core/modules/taxonomy/src/Tests/Views/RelationshipRepresentativeNode.php @@ -35,7 +35,7 @@ public static function getInfo() { public function testRelationship() { $view = Views::getView('test_groupwise_term'); $this->executeView($view); - $map = array('node_taxonomy_term_data_nid' => 'nid', 'tid' => 'tid'); + $map = array('node_taxonomy_term_field_data_nid' => 'nid', 'tid' => 'tid'); $expected_result = array( array( 'nid' => $this->nodes[1]->id(), diff --git a/core/modules/taxonomy/taxonomy.views.inc b/core/modules/taxonomy/taxonomy.views.inc index 2dfa5b2..8c01580 100644 --- a/core/modules/taxonomy/taxonomy.views.inc +++ b/core/modules/taxonomy/taxonomy.views.inc @@ -14,21 +14,21 @@ function taxonomy_views_data() { $data = array(); - // taxonomy_term_data table + // taxonomy_term_field_data table - $data['taxonomy_term_data']['table']['group'] = t('Taxonomy term'); - $data['taxonomy_term_data']['table']['base'] = array( + $data['taxonomy_term_field_data']['table']['group'] = t('Taxonomy term'); + $data['taxonomy_term_field_data']['table']['base'] = array( 'field' => 'tid', 'title' => t('Term'), 'help' => t('Taxonomy terms are attached to nodes.'), 'access query tag' => 'term_access', ); - $data['taxonomy_term_data']['table']['entity type'] = 'taxonomy_term'; - $data['taxonomy_term_data']['table']['wizard_id'] = 'taxonomy_term'; + $data['taxonomy_term_field_data']['table']['entity type'] = 'taxonomy_term'; + $data['taxonomy_term_field_data']['table']['wizard_id'] = 'taxonomy_term'; // The term data table - $data['taxonomy_term_data']['table']['join'] = array( + $data['taxonomy_term_field_data']['table']['join'] = array( // This is provided for many_to_one argument 'taxonomy_index' => array( 'field' => 'tid', @@ -37,7 +37,7 @@ function taxonomy_views_data() { ); // tid field - $data['taxonomy_term_data']['tid'] = array( + $data['taxonomy_term_field_data']['tid'] = array( 'title' => t('Term ID'), 'help' => t('The tid of a taxonomy term.'), 'field' => array( @@ -61,7 +61,7 @@ function taxonomy_views_data() { ); // raw tid field - $data['taxonomy_term_data']['tid_raw'] = array( + $data['taxonomy_term_field_data']['tid_raw'] = array( 'title' => t('Term ID'), 'help' => t('The tid of a taxonomy term.'), 'real field' => 'tid', @@ -71,15 +71,15 @@ function taxonomy_views_data() { ), ); - $data['taxonomy_term_data']['tid_representative'] = array( + $data['taxonomy_term_field_data']['tid_representative'] = array( 'relationship' => array( 'title' => t('Representative node'), 'label' => t('Representative node'), 'help' => t('Obtains a single representative node for each term, according to a chosen sort criterion.'), 'id' => 'groupwise_max', 'relationship field' => 'tid', - 'outer field' => 'taxonomy_term_data.tid', - 'argument table' => 'taxonomy_term_data', + 'outer field' => 'taxonomy_term_field_data.tid', + 'argument table' => 'taxonomy_term_field_data', 'argument field' => 'tid', 'base' => 'node', 'field' => 'nid', @@ -88,7 +88,7 @@ function taxonomy_views_data() { ); // Term name field - $data['taxonomy_term_data']['name'] = array( + $data['taxonomy_term_field_data']['name'] = array( 'title' => t('Name'), 'help' => t('The taxonomy term name.'), 'field' => array( @@ -110,7 +110,7 @@ function taxonomy_views_data() { ); // taxonomy weight - $data['taxonomy_term_data']['weight'] = array( + $data['taxonomy_term_field_data']['weight'] = array( 'title' => t('Weight'), 'help' => t('The term weight field'), 'field' => array( @@ -128,7 +128,7 @@ function taxonomy_views_data() { ); // Term description - $data['taxonomy_term_data']['description__value'] = array( + $data['taxonomy_term_field_data']['description__value'] = array( 'title' => t('Term description'), 'help' => t('The description associated with a taxonomy term.'), 'field' => array( @@ -142,7 +142,7 @@ function taxonomy_views_data() { ); // Term vocabulary - $data['taxonomy_term_data']['vid'] = array( + $data['taxonomy_term_field_data']['vid'] = array( 'title' => t('Vocabulary'), 'help' => t('Filter the results of "Taxonomy: Term" to a particular vocabulary.'), 'filter' => array( @@ -150,7 +150,7 @@ function taxonomy_views_data() { ), ); - $data['taxonomy_term_data']['langcode'] = array( + $data['taxonomy_term_field_data']['langcode'] = array( 'title' => t('Language'), // The item it appears as on the UI, 'help' => t('Language of the term'), 'field' => array( @@ -168,7 +168,7 @@ function taxonomy_views_data() { ); // Link to edit the term - $data['taxonomy_term_data']['edit_term'] = array( + $data['taxonomy_term_field_data']['edit_term'] = array( 'field' => array( 'title' => t('Term edit link'), 'help' => t('Provide a simple link to edit the term.'), @@ -177,7 +177,7 @@ function taxonomy_views_data() { ), ); - $data['taxonomy_term_data']['changed'] = array( + $data['taxonomy_term_field_data']['changed'] = array( 'title' => t('Updated date'), 'help' => t('The date the term was last updated.'), 'field' => array( @@ -191,7 +191,7 @@ function taxonomy_views_data() { ), ); - $data['taxonomy_term_data']['changed_fulldate'] = array( + $data['taxonomy_term_field_data']['changed_fulldate'] = array( 'title' => t('Updated date'), 'help' => t('Date in the form of CCYYMMDD.'), 'argument' => array( @@ -200,7 +200,7 @@ function taxonomy_views_data() { ), ); - $data['taxonomy_term_data']['changed_year_month'] = array( + $data['taxonomy_term_field_data']['changed_year_month'] = array( 'title' => t('Updated year + month'), 'help' => t('Date in the form of YYYYMM.'), 'argument' => array( @@ -209,7 +209,7 @@ function taxonomy_views_data() { ), ); - $data['taxonomy_term_data']['changed_year'] = array( + $data['taxonomy_term_field_data']['changed_year'] = array( 'title' => t('Updated year'), 'help' => t('Date in the form of YYYY.'), 'argument' => array( @@ -218,7 +218,7 @@ function taxonomy_views_data() { ), ); - $data['taxonomy_term_data']['changed_month'] = array( + $data['taxonomy_term_field_data']['changed_month'] = array( 'title' => t('Updated month'), 'help' => t('Date in the form of MM (01 - 12).'), 'argument' => array( @@ -227,7 +227,7 @@ function taxonomy_views_data() { ), ); - $data['taxonomy_term_data']['changed_day'] = array( + $data['taxonomy_term_field_data']['changed_day'] = array( 'title' => t('Updated day'), 'help' => t('Date in the form of DD (01 - 31).'), 'argument' => array( @@ -236,7 +236,7 @@ function taxonomy_views_data() { ), ); - $data['taxonomy_term_data']['changed_week'] = array( + $data['taxonomy_term_field_data']['changed_week'] = array( 'title' => t('Updated week'), 'help' => t('Date in the form of WW (01 - 53).'), 'argument' => array( @@ -247,7 +247,7 @@ function taxonomy_views_data() { // Content translation field. if (\Drupal::moduleHandler()->moduleExists('content_translation')) { - $data['taxonomy_term_data']['translation_link'] = array( + $data['taxonomy_term_field_data']['translation_link'] = array( 'title' => t('Translation link'), 'help' => t('Provide a link to the translations overview for taxonomy terms.'), 'field' => array( @@ -261,8 +261,8 @@ function taxonomy_views_data() { $data['taxonomy_index']['table']['group'] = t('Taxonomy term'); $data['taxonomy_index']['table']['join'] = array( - 'taxonomy_term_data' => array( - // links directly to taxonomy_term_data via tid + 'taxonomy_term_field_data' => array( + // links directly to taxonomy_term_field_data via tid 'left_field' => 'tid', 'field' => 'tid', ), @@ -298,18 +298,18 @@ function taxonomy_views_data() { 'help' => t('Display content if it has the selected taxonomy terms.'), 'argument' => array( 'id' => 'taxonomy_index_tid', - 'name table' => 'taxonomy_term_data', + 'name table' => 'taxonomy_term_field_data', 'name field' => 'name', 'empty field name' => t('Uncategorized'), 'numeric' => TRUE, - 'skip base' => 'taxonomy_term_data', + 'skip base' => 'taxonomy_term_field_data', ), 'filter' => array( 'title' => t('Has taxonomy term'), 'id' => 'taxonomy_index_tid', 'hierarchy table' => 'taxonomy_term_hierarchy', 'numeric' => TRUE, - 'skip base' => 'taxonomy_term_data', + 'skip base' => 'taxonomy_term_field_data', 'allow empty' => TRUE, ), ); @@ -324,8 +324,8 @@ function taxonomy_views_data() { 'left_field' => 'tid', 'field' => 'parent', ), - 'taxonomy_term_data' => array( - // links directly to taxonomy_term_data via tid + 'taxonomy_term_field_data' => array( + // links directly to taxonomy_term_field_data via tid 'left_field' => 'tid', 'field' => 'tid', ), @@ -335,7 +335,7 @@ function taxonomy_views_data() { 'title' => t('Parent term'), 'help' => t('The parent term of the term. This can produce duplicate entries if you are using a vocabulary that allows multiple parents.'), 'relationship' => array( - 'base' => 'taxonomy_term_data', + 'base' => 'taxonomy_term_field_data', 'field' => 'parent', 'label' => t('Parent'), 'id' => 'standard', @@ -363,7 +363,7 @@ function taxonomy_views_data_alter(&$data) { 'relationship' => array( 'id' => 'node_term_data', 'label' => t('term'), - 'base' => 'taxonomy_term_data', + 'base' => 'taxonomy_term_field_data', ), 'field' => array( 'title' => t('All taxonomy terms'), @@ -420,7 +420,7 @@ function taxonomy_field_views_data(FieldConfigInterface $field) { $field_name = $field->getName(); $data[$table_name][$field_name . '_target_id']['relationship'] = array( 'id' => 'standard', - 'base' => 'taxonomy_term_data', + 'base' => 'taxonomy_term_field_data', 'base field' => 'tid', 'label' => t('term from !field_name', array('!field_name' => $field_name)), ); @@ -443,7 +443,7 @@ function taxonomy_field_views_data_views_data_alter(array &$data, FieldConfigInt list($label) = field_views_field_label($entity_type_id, $field_name); - $data['taxonomy_term_data'][$pseudo_field_name]['relationship'] = array( + $data['taxonomy_term_field_data'][$pseudo_field_name]['relationship'] = array( 'title' => t('@entity using @field', array('@entity' => $entity_type->getLabel(), '@field' => $label)), 'help' => t('Relate each @entity with a @field set to the term.', array('@entity' => $entity_type->getLabel(), '@field' => $label)), 'id' => 'entity_reverse', diff --git a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_groupwise_term.yml b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_groupwise_term.yml index 5fd37bc..739cf1a 100644 --- a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_groupwise_term.yml +++ b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_groupwise_term.yml @@ -1,5 +1,5 @@ base_field: tid -base_table: taxonomy_term_data +base_table: taxonomy_term_field_data core: 8.0-dev description: '' status: true @@ -16,7 +16,7 @@ display: name: field: name id: name - table: taxonomy_term_data + table: taxonomy_term_field_data plugin_id: taxonomy provider: taxonomy nid: @@ -46,7 +46,7 @@ display: subquery_regenerate: true subquery_sort: node.nid subquery_view: '' - table: taxonomy_term_data + table: taxonomy_term_field_data plugin_id: groupwise_max provider: views row: @@ -56,7 +56,7 @@ display: field: tid id: tid order: DESC - table: taxonomy_term_data + table: taxonomy_term_field_data plugin_id: standard provider: views style: diff --git a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_node_term_data.yml b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_node_term_data.yml index a3fc3ca..3350d32 100644 --- a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_node_term_data.yml +++ b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_node_term_data.yml @@ -18,7 +18,7 @@ display: number_of_records: 0 summary_options: items_per_page: 25 - table: taxonomy_term_data + table: taxonomy_term_field_data plugin_id: taxonomy provider: taxonomy tid_1: @@ -31,7 +31,7 @@ display: number_of_records: 0 summary_options: items_per_page: 25 - table: taxonomy_term_data + table: taxonomy_term_field_data plugin_id: taxonomy provider: taxonomy cache: diff --git a/core/modules/views/src/Tests/Handler/HandlerAllTest.php b/core/modules/views/src/Tests/Handler/HandlerAllTest.php index 08fdb76..b90ce57 100644 --- a/core/modules/views/src/Tests/Handler/HandlerAllTest.php +++ b/core/modules/views/src/Tests/Handler/HandlerAllTest.php @@ -66,7 +66,7 @@ public function testHandlers() { $view = $view->getExecutable(); // @todo The groupwise relationship is currently broken. - $exclude[] = 'taxonomy_term_data:tid_representative'; + $exclude[] = 'taxonomy_term_field_data:tid_representative'; $exclude[] = 'users:uid_representative'; // Go through all fields and there through all handler types.