diff --git a/core/modules/block_content/src/BlockContentViewsData.php b/core/modules/block_content/src/BlockContentViewsData.php index 7950d78..200d18f 100644 --- a/core/modules/block_content/src/BlockContentViewsData.php +++ b/core/modules/block_content/src/BlockContentViewsData.php @@ -21,7 +21,7 @@ public function getViewsData() { $data = parent::getViewsData(); - $data['block_content']['id']['field']['id'] = 'block_content'; + $data['block_content_field_data']['id']['field']['id'] = 'block_content'; $data['block_content_field_data']['info']['field']['id'] = 'block_content'; $data['block_content_field_data']['info']['field']['link_to_entity default'] = TRUE; diff --git a/core/modules/block_content/tests/modules/block_content_test_views/test_views/views.view.test_field_type.yml b/core/modules/block_content/tests/modules/block_content_test_views/test_views/views.view.test_field_type.yml index 5c8fe27..c11426b 100644 --- a/core/modules/block_content/tests/modules/block_content_test_views/test_views/views.view.test_field_type.yml +++ b/core/modules/block_content/tests/modules/block_content_test_views/test_views/views.view.test_field_type.yml @@ -8,7 +8,7 @@ label: '' module: views description: '' tag: '' -base_table: block_content +base_table: block_content_field_data base_field: id core: '8' display: diff --git a/core/modules/comment/src/Plugin/views/field/Username.php b/core/modules/comment/src/Plugin/views/field/Username.php index c82a301..7568a81 100644 --- a/core/modules/comment/src/Plugin/views/field/Username.php +++ b/core/modules/comment/src/Plugin/views/field/Username.php @@ -43,6 +43,11 @@ protected function defineOptions() { return $options; } + public function query() { + parent::query(); + } + + /** * {@inheritdoc} */ diff --git a/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_rss.yml b/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_rss.yml index b9b4c48..a3ca208 100644 --- a/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_rss.yml +++ b/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_rss.yml @@ -10,7 +10,7 @@ label: test_comment_rss module: views description: '' tag: '' -base_table: comment +base_table: comment_field_data base_field: cid core: 8.x display: diff --git a/core/modules/entity_reference/src/Tests/Views/SelectionTest.php b/core/modules/entity_reference/src/Tests/Views/SelectionTest.php index 5e98176..7540b60 100644 --- a/core/modules/entity_reference/src/Tests/Views/SelectionTest.php +++ b/core/modules/entity_reference/src/Tests/Views/SelectionTest.php @@ -118,7 +118,7 @@ public function testSelectionHandlerRelationship() { $view->displayHandlers->get('default')->setOption('relationships', array( 'test_relationship' => array( 'id' => 'uid', - 'table' => 'users', + 'table' => 'user_field_data', 'field' => 'uid', ), )); @@ -127,7 +127,7 @@ public function testSelectionHandlerRelationship() { $view->displayHandlers->get('default')->setOption('filters', array( 'uid' => array( 'id' => 'uid', - 'table' => 'users', + 'table' => 'user_field_data', 'field' => 'uid', 'relationship' => 'test_relationship', ) diff --git a/core/modules/entity_reference/tests/modules/entity_reference_test/config/install/views.view.test_entity_reference.yml b/core/modules/entity_reference/tests/modules/entity_reference_test/config/install/views.view.test_entity_reference.yml index 645be9e..2abda30 100644 --- a/core/modules/entity_reference/tests/modules/entity_reference_test/config/install/views.view.test_entity_reference.yml +++ b/core/modules/entity_reference/tests/modules/entity_reference_test/config/install/views.view.test_entity_reference.yml @@ -11,7 +11,7 @@ label: 'Entity reference' module: entity_reference_test description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: '8' display: diff --git a/core/modules/history/history.views.inc b/core/modules/history/history.views.inc index 50e12aa..4b98136 100644 --- a/core/modules/history/history.views.inc +++ b/core/modules/history/history.views.inc @@ -19,7 +19,7 @@ function history_views_data() { // Explain how this table joins to others. $data['history']['table']['join'] = array( // Directly links to node table. - 'node' => array( + 'node_field_data' => array( 'table' => 'history', 'left_field' => 'nid', 'field' => 'nid', diff --git a/core/modules/node/src/Plugin/views/field/Node.php b/core/modules/node/src/Plugin/views/field/Node.php index d5ee4cc..43077e2 100644 --- a/core/modules/node/src/Plugin/views/field/Node.php +++ b/core/modules/node/src/Plugin/views/field/Node.php @@ -33,7 +33,7 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o // Don't add the additional fields to groupby if (!empty($this->options['link_to_node'])) { - $this->additional_fields['nid'] = array('table' => 'node', 'field' => 'nid'); + $this->additional_fields['nid'] = array('table' => 'node_field_data', 'field' => 'nid'); } } diff --git a/core/modules/node/src/Tests/Views/NodeRevisionWizardTest.php b/core/modules/node/src/Tests/Views/NodeRevisionWizardTest.php index 800b52f..7e1209b 100644 --- a/core/modules/node/src/Tests/Views/NodeRevisionWizardTest.php +++ b/core/modules/node/src/Tests/Views/NodeRevisionWizardTest.php @@ -54,13 +54,13 @@ public function testViewAdd() { /** @var \Drupal\views\Entity\View $view */ $view = $view_storage_controller->load($view['id']); - $this->assertEqual($view->get('base_table'), 'node_revision'); + $this->assertEqual($view->get('base_table'), 'node_field_revision'); $executable = Views::executableFactory()->get($view); $this->executeView($executable); $this->assertIdenticalResultset($executable, array(array('vid' => 1), array('vid' => 3), array('vid' => 2), array('vid' => 4)), - array('node_field_revision_vid' => 'vid')); + array('vid' => 'vid')); } } diff --git a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_field_type.yml b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_field_type.yml index f7e1e82..d779464 100644 --- a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_field_type.yml +++ b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_field_type.yml @@ -8,7 +8,7 @@ label: '' module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: '8' display: diff --git a/core/modules/options/tests/options_test_views/test_views/views.view.test_options_list_argument_numeric.yml b/core/modules/options/tests/options_test_views/test_views/views.view.test_options_list_argument_numeric.yml index 8cbff7b..5763f70 100644 --- a/core/modules/options/tests/options_test_views/test_views/views.view.test_options_list_argument_numeric.yml +++ b/core/modules/options/tests/options_test_views/test_views/views.view.test_options_list_argument_numeric.yml @@ -11,7 +11,7 @@ label: 'test options list argument (numeric)' module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: 8.x display: diff --git a/core/modules/options/tests/options_test_views/test_views/views.view.test_options_list_argument_string.yml b/core/modules/options/tests/options_test_views/test_views/views.view.test_options_list_argument_string.yml index 00040da..7249f6d 100644 --- a/core/modules/options/tests/options_test_views/test_views/views.view.test_options_list_argument_string.yml +++ b/core/modules/options/tests/options_test_views/test_views/views.view.test_options_list_argument_string.yml @@ -11,7 +11,7 @@ label: 'test options list argument (string)' module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: 8.x display: diff --git a/core/modules/options/tests/options_test_views/test_views/views.view.test_options_list_filter.yml b/core/modules/options/tests/options_test_views/test_views/views.view.test_options_list_filter.yml index 6028d96..ed6a530 100644 --- a/core/modules/options/tests/options_test_views/test_views/views.view.test_options_list_filter.yml +++ b/core/modules/options/tests/options_test_views/test_views/views.view.test_options_list_filter.yml @@ -11,7 +11,7 @@ label: test_options_list_filter module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: 8.x display: diff --git a/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php b/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php index 81fd898..e8ad1e5 100644 --- a/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php +++ b/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php @@ -72,7 +72,7 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o $this->additional_fields['nid'] = array('table' => 'node_field_revision', 'field' => 'nid'); } else { - $this->additional_fields['nid'] = array('table' => 'node', 'field' => 'nid'); + $this->additional_fields['nid'] = array('table' => 'node_field_data', 'field' => 'nid'); } } diff --git a/core/modules/taxonomy/src/TermViewsData.php b/core/modules/taxonomy/src/TermViewsData.php index 4b4e578..3ffe280 100644 --- a/core/modules/taxonomy/src/TermViewsData.php +++ b/core/modules/taxonomy/src/TermViewsData.php @@ -20,11 +20,11 @@ class TermViewsData extends EntityViewsData { public function getViewsData() { $data = parent::getViewsData(); - $data['taxonomy_term_data']['table']['base']['help'] = t('Taxonomy terms are attached to nodes.'); - $data['taxonomy_term_data']['table']['base']['access query tag'] = 'term_access'; - $data['taxonomy_term_data']['table']['wizard_id'] = 'taxonomy_term'; + $data['taxonomy_term_field_data']['table']['base']['help'] = t('Taxonomy terms are attached to nodes.'); + $data['taxonomy_term_field_data']['table']['base']['access query tag'] = 'term_access'; + $data['taxonomy_term_field_data']['table']['wizard_id'] = 'taxonomy_term'; - $data['taxonomy_term_data']['table']['join'] = array( + $data['taxonomy_term_field_data']['table']['join'] = array( // This is provided for the many_to_one argument. 'taxonomy_index' => array( 'field' => 'tid', @@ -32,19 +32,19 @@ public function getViewsData() { ), ); - $data['taxonomy_term_data']['tid']['help'] = t('The tid of a taxonomy term.'); + $data['taxonomy_term_field_data']['tid']['help'] = t('The tid of a taxonomy term.'); - $data['taxonomy_term_data']['tid']['argument']['id'] = 'taxonomy'; - $data['taxonomy_term_data']['tid']['argument']['name field'] = 'name'; - $data['taxonomy_term_data']['tid']['argument']['zero is null'] = TRUE; + $data['taxonomy_term_field_data']['tid']['argument']['id'] = 'taxonomy'; + $data['taxonomy_term_field_data']['tid']['argument']['name field'] = 'name'; + $data['taxonomy_term_field_data']['tid']['argument']['zero is null'] = TRUE; - $data['taxonomy_term_data']['tid']['filter']['id'] = 'taxonomy_index_tid'; - $data['taxonomy_term_data']['tid']['filter']['title'] = t('Term'); - $data['taxonomy_term_data']['tid']['filter']['help'] = t('Taxonomy term chosen from autocomplete or select widget.'); - $data['taxonomy_term_data']['tid']['filter']['hierarchy table'] = 'taxonomy_term_hierarchy'; - $data['taxonomy_term_data']['tid']['filter']['numeric'] = TRUE; + $data['taxonomy_term_field_data']['tid']['filter']['id'] = 'taxonomy_index_tid'; + $data['taxonomy_term_field_data']['tid']['filter']['title'] = t('Term'); + $data['taxonomy_term_field_data']['tid']['filter']['help'] = t('Taxonomy term chosen from autocomplete or select widget.'); + $data['taxonomy_term_field_data']['tid']['filter']['hierarchy table'] = 'taxonomy_term_hierarchy'; + $data['taxonomy_term_field_data']['tid']['filter']['numeric'] = TRUE; - $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', @@ -70,10 +70,10 @@ public function getViewsData() { ), ); - $data['taxonomy_term_data']['vid']['help'] = t('Filter the results of "Taxonomy: Term" to a particular vocabulary.'); - unset($data['taxonomy_term_data']['vid']['field']); - unset($data['taxonomy_term_data']['vid']['argument']); - unset($data['taxonomy_term_data']['vid']['sort']); + $data['taxonomy_term_field_data']['vid']['help'] = t('Filter the results of "Taxonomy: Term" to a particular vocabulary.'); + unset($data['taxonomy_term_field_data']['vid']['field']); + unset($data['taxonomy_term_field_data']['vid']['argument']); + unset($data['taxonomy_term_field_data']['vid']['sort']); $data['taxonomy_term_data']['edit_term'] = array( 'field' => array( diff --git a/core/modules/tracker/tracker.views.inc b/core/modules/tracker/tracker.views.inc index 14c125e..5747e62 100644 --- a/core/modules/tracker/tracker.views.inc +++ b/core/modules/tracker/tracker.views.inc @@ -13,7 +13,7 @@ function tracker_views_data() { $data['tracker_node']['table']['group'] = t('Tracker'); $data['tracker_node']['table']['join'] = array( - 'node' => array( + 'node_field_data' => array( 'type' => 'INNER', 'left_field' => 'nid', 'field' => 'nid', @@ -158,7 +158,7 @@ function tracker_views_data() { */ function tracker_views_data_alter(&$data) { // Provide additional uid_touch handlers which are handled by tracker - $data['node']['uid_touch_tracker'] = array( + $data['node_field_data']['uid_touch_tracker'] = array( 'group' => t('Tracker - User'), 'title' => t('User posted or commented'), 'help' => t('Display nodes only if a user posted the node or commented on the node.'), diff --git a/core/modules/views/src/EntityViewsData.php b/core/modules/views/src/EntityViewsData.php index e0704f3..9ff52ec 100644 --- a/core/modules/views/src/EntityViewsData.php +++ b/core/modules/views/src/EntityViewsData.php @@ -163,7 +163,7 @@ public function getViewsData() { // Setup relations to the revisions/property data. if ($data_table) { - $data[$data_table]['table']['join'][$base_table] = [ + $data[$base_table]['table']['join'][$data_table] = [ 'left_field' => $base_field, 'field' => $base_field, 'type' => 'INNER' diff --git a/core/modules/views/src/Plugin/views/row/EntityRow.php b/core/modules/views/src/Plugin/views/row/EntityRow.php index 071314f..a0df1e1 100644 --- a/core/modules/views/src/Plugin/views/row/EntityRow.php +++ b/core/modules/views/src/Plugin/views/row/EntityRow.php @@ -92,7 +92,7 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o $this->entityTypeId = $this->definition['entity_type']; $this->entityType = $this->entityManager->getDefinition($this->entityTypeId); - $this->base_table = $this->entityType->getBaseTable(); + $this->base_table = $this->entityType->getDataTable() ?: $this->entityType->getBaseTable(); $this->base_field = $this->entityType->getKey('id'); } diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_filter_date_between.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_filter_date_between.yml index 83521ca..f5f1c1e 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_filter_date_between.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_filter_date_between.yml @@ -8,7 +8,7 @@ label: '' module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: '8' display: @@ -24,7 +24,7 @@ display: nid: field: nid id: nid - table: node + table: node_field_data plugin_id: node entity_type: node entity_field: nid diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_history.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_history.yml index feeeac8..7f13a2c 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_history.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_history.yml @@ -10,7 +10,7 @@ label: test_history module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: 8.x display: diff --git a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php index 6ef7bc2..cb2f0eb 100644 --- a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php +++ b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php @@ -186,7 +186,7 @@ public function testDataTable() { // Tests the join definition between the base and the data table. $data = $this->viewsData->getViewsData(); - $field_views_data = $data['entity_test_mul_property_data']; + $base_views_data = $data['entity_test']; // Ensure that the base table it set to the data table. $this->assertEquals('id', $data['entity_test_mul_property_data']['table']['base']['field']); @@ -199,8 +199,8 @@ public function testDataTable() { $this->assertEquals(['field' => 'label', 'table' => 'entity_test_mul_property_data'], $data['entity_test_mul_property_data']['table']['base']['defaults']); // Ensure the join information is set up properly. - $this->assertCount(1, $field_views_data['table']['join']); - $this->assertEquals(['entity_test' => ['left_field' => 'id', 'field' => 'id', 'type' => 'INNER']], $field_views_data['table']['join']); + $this->assertCount(1, $base_views_data['table']['join']); + $this->assertEquals(['entity_test_mul_property_data' => ['left_field' => 'id', 'field' => 'id', 'type' => 'INNER']], $base_views_data['table']['join']); $this->assertFalse(isset($data['revision_table'])); $this->assertFalse(isset($data['revision_data_table'])); } @@ -231,9 +231,6 @@ public function testRevisionTableWithoutDataTable() { $revision_data = $data['entity_test_mulrev_revision']; $this->assertCount(1, $revision_data['table']['join']); $this->assertEquals(['entity_test' => ['left_field' => 'revision_id', 'field' => 'revision_id', 'type' => 'INNER']], $revision_data['table']['join']); - $revision_data = $data['entity_test_mulrev_property_revision']; - $this->assertCount(1, $revision_data['table']['join']); - $this->assertEquals(['entity_test_mulrev_revision' => ['left_field' => 'revision_id', 'field' => 'revision_id', 'type' => 'INNER']], $revision_data['table']['join']); $this->assertFalse(isset($data['data_table'])); }