diff --git a/core/modules/action/tests/action_bulk_test/config/install/views.view.test_bulk_form.yml b/core/modules/action/tests/action_bulk_test/config/install/views.view.test_bulk_form.yml index 90a46ff..e418001 100644 --- a/core/modules/action/tests/action_bulk_test/config/install/views.view.test_bulk_form.yml +++ b/core/modules/action/tests/action_bulk_test/config/install/views.view.test_bulk_form.yml @@ -9,7 +9,7 @@ label: form module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: 8.x display: diff --git a/core/modules/block_content/tests/modules/block_content_test_views/test_views/views.view.test_block_content_view.yml b/core/modules/block_content/tests/modules/block_content_test_views/test_views/views.view.test_block_content_view.yml index a5a9592..2e12c10 100644 --- a/core/modules/block_content/tests/modules/block_content_test_views/test_views/views.view.test_block_content_view.yml +++ b/core/modules/block_content/tests/modules/block_content_test_views/test_views/views.view.test_block_content_view.yml @@ -8,7 +8,7 @@ label: test_block_content_view module: views description: '' tag: '' -base_table: block_content +base_table: block_content_field_data base_field: id core: 8.x display: @@ -70,7 +70,7 @@ display: fields: id: id: id - table: block_content + table: block_content_field_data field: id relationship: none group_type: group @@ -123,7 +123,7 @@ display: sorts: id: id: id - table: block_content + table: block_content_field_data field: id relationship: none group_type: group @@ -144,7 +144,7 @@ display: arguments: type: id: type - table: block_content + table: block_content_field_data field: type relationship: none group_type: group diff --git a/core/modules/block_content/tests/modules/block_content_test_views/test_views/views.view.test_field_filters.yml b/core/modules/block_content/tests/modules/block_content_test_views/test_views/views.view.test_field_filters.yml index a004f43..057cd61 100644 --- a/core/modules/block_content/tests/modules/block_content_test_views/test_views/views.view.test_field_filters.yml +++ b/core/modules/block_content/tests/modules/block_content_test_views/test_views/views.view.test_field_filters.yml @@ -8,7 +8,7 @@ label: 'Test field filters' module: views description: '' tag: '' -base_table: block_content +base_table: block_content_field_data base_field: id core: 8.x display: diff --git a/core/modules/comment/src/CommentViewsData.php b/core/modules/comment/src/CommentViewsData.php index 2b5ed89..7c68bb7 100644 --- a/core/modules/comment/src/CommentViewsData.php +++ b/core/modules/comment/src/CommentViewsData.php @@ -190,7 +190,7 @@ public function getViewsData() { 'relationship' => array( 'title' => $entity_type->getLabel(), 'help' => t('The @entity_type to which the comment is a reply to.', array('@entity_type' => $entity_type->getLabel())), - 'base' => $entity_type->getBaseTable(), + 'base' => $entity_type->getDataTable() ?: $entity_type->getBaseTable(), 'base field' => $entity_type->getKey('id'), 'relationship field' => 'entity_id', 'id' => 'standard', @@ -245,7 +245,7 @@ public function getViewsData() { // {comment_entity_statistics} for each field as multiple joins between // the same two tables is not supported. if (\Drupal::service('comment.manager')->getFields($type)) { - $data['comment_entity_statistics']['table']['join'][$entity_type->getBaseTable()] = array( + $data['comment_entity_statistics']['table']['join'][$entity_type->getDataTable() ?: $entity_type->getBaseTable()] = array( 'type' => 'INNER', 'left_field' => $entity_type->getKey('id'), 'field' => 'entity_id', diff --git a/core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php b/core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php index 860d5bd..69de338 100644 --- a/core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php +++ b/core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php @@ -20,7 +20,7 @@ class StatisticsLastUpdated extends Date { public function query() { $this->ensureMyTable(); - $this->node_table = $this->query->ensureTable('node', $this->relationship); + $this->node_table = $this->query->ensureTable('node_field_data', $this->relationship); $this->field_alias = $this->query->addField(NULL, "GREATEST(" . $this->node_table . ".changed, " . $this->tableAlias . ".last_comment_timestamp)", $this->tableAlias . '_' . $this->field); } diff --git a/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_rest.yml b/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_rest.yml index 7df6536..0c53369 100644 --- a/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_rest.yml +++ b/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_rest.yml @@ -14,7 +14,7 @@ label: 'Comments by node' module: views description: '' tag: '' -base_table: comment +base_table: comment_field_data base_field: cid core: 8.x display: diff --git a/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_row.yml b/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_row.yml index fa3a4f0..6063d89 100644 --- a/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_row.yml +++ b/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_row.yml @@ -10,7 +10,7 @@ label: test_comment_row module: views description: '' tag: '' -base_table: comment +base_table: comment_field_data base_field: cid core: 8.x display: diff --git a/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_field_filters.yml b/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_field_filters.yml index 2a950fc..7b848df 100644 --- a/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_field_filters.yml +++ b/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_field_filters.yml @@ -10,7 +10,7 @@ label: 'Test field filters' 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 7540b60..9faf512 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' => 'user_field_data', + 'table' => 'users_field_data', 'field' => 'uid', ), )); @@ -127,7 +127,7 @@ public function testSelectionHandlerRelationship() { $view->displayHandlers->get('default')->setOption('filters', array( 'uid' => array( 'id' => 'uid', - 'table' => 'user_field_data', + 'table' => 'users_field_data', 'field' => 'uid', 'relationship' => 'test_relationship', ) diff --git a/core/modules/file/src/FileViewsData.php b/core/modules/file/src/FileViewsData.php index 5a977a2..ec9685b 100644 --- a/core/modules/file/src/FileViewsData.php +++ b/core/modules/file/src/FileViewsData.php @@ -79,28 +79,28 @@ public function getViewsData() { ), // Link ourself to the {node} table // so we can provide node->file relationships. - 'node' => array( + 'node_field_data' => array( 'field' => 'id', 'left_field' => 'nid', 'extra' => array(array('field' => 'type', 'value' => 'node')), ), // Link ourself to the {users} table // so we can provide user->file relationships. - 'users' => array( + 'users_field_data' => array( 'field' => 'id', 'left_field' => 'uid', 'extra' => array(array('field' => 'type', 'value' => 'user')), ), // Link ourself to the {comment} table // so we can provide comment->file relationships. - 'comment' => array( + 'comment_field_data' => array( 'field' => 'id', 'left_field' => 'cid', 'extra' => array(array('field' => 'type', 'value' => 'comment')), ), // Link ourself to the {taxonomy_term_data} table // so we can provide taxonomy_term->file relationships. - 'taxonomy_term_data' => array( + 'taxonomy_term_field_data' => array( 'field' => 'id', 'left_field' => 'tid', 'extra' => array(array('field' => 'type', 'value' => 'taxonomy_term')), @@ -126,12 +126,12 @@ public function getViewsData() { 'help' => t('Content that is associated with this file, usually because this file is in a field on the content.'), // Only provide this field/relationship/etc., // when the 'file_managed' base table is present. - 'skip base' => array('node', 'node_field_revision', 'users', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'), + 'skip base' => array('node_field_data', 'node_field_revision', 'users_field_data', 'comment_field_data', 'taxonomy_term_field_data', 'taxonomy_vocabulary'), 'real field' => 'id', 'relationship' => array( 'title' => t('Content'), 'label' => t('Content'), - 'base' => 'node', + 'base' => 'node_field_data', 'base field' => 'nid', 'relationship field' => 'id', 'extra' => array(array('table' => 'file_usage', 'field' => 'type', 'operator' => '=', 'value' => 'node')), @@ -142,7 +142,7 @@ public function getViewsData() { 'help' => t('A file that is associated with this node, usually because it is in a field on the node.'), // Only provide this field/relationship/etc., // when the 'node' base table is present. - 'skip base' => array('file_managed', 'users', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'), + 'skip base' => array('file_managed', 'users_field_data', 'comment_field_data', 'taxonomy_term_field_data', 'taxonomy_vocabulary'), 'real field' => 'fid', 'relationship' => array( 'title' => t('File'), @@ -159,7 +159,7 @@ public function getViewsData() { 'help' => t('A user that is associated with this file, usually because this file is in a field on the user.'), // Only provide this field/relationship/etc., // when the 'file_managed' base table is present. - 'skip base' => array('node', 'node_field_revision', 'users', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'), + 'skip base' => array('node_field_data', 'node_field_revision', 'users_field_data', 'comment_field_data', 'taxonomy_term_field_data', 'taxonomy_vocabulary'), 'real field' => 'id', 'relationship' => array( 'title' => t('User'), @@ -175,7 +175,7 @@ public function getViewsData() { 'help' => t('A file that is associated with this user, usually because it is in a field on the user.'), // Only provide this field/relationship/etc., // when the 'users' base table is present. - 'skip base' => array('file_managed', 'node', 'node_field_revision', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'), + 'skip base' => array('file_managed', 'node_field_data', 'node_field_revision', 'comment_field_data', 'taxonomy_term_field_data', 'taxonomy_vocabulary'), 'real field' => 'fid', 'relationship' => array( 'title' => t('File'), @@ -192,12 +192,12 @@ public function getViewsData() { 'help' => t('A comment that is associated with this file, usually because this file is in a field on the comment.'), // Only provide this field/relationship/etc., // when the 'file_managed' base table is present. - 'skip base' => array('node', 'node_field_revision', 'users', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'), + 'skip base' => array('node_field_data', 'node_field_revision', 'users_field_data', 'comment_field_data', 'taxonomy_term_field_data', 'taxonomy_vocabulary'), 'real field' => 'id', 'relationship' => array( 'title' => t('Comment'), 'label' => t('Comment'), - 'base' => 'comment', + 'base' => 'comment_field_data', 'base field' => 'cid', 'relationship field' => 'id', 'extra' => array(array('table' => 'file_usage', 'field' => 'type', 'operator' => '=', 'value' => 'comment')), @@ -208,7 +208,7 @@ public function getViewsData() { 'help' => t('A file that is associated with this comment, usually because it is in a field on the comment.'), // Only provide this field/relationship/etc., // when the 'comment' base table is present. - 'skip base' => array('file_managed', 'node', 'node_field_revision', 'users', 'taxonomy_term_data', 'taxonomy_vocabulary'), + 'skip base' => array('file_managed', 'node_field_data', 'node_field_revision', 'users_field_data', 'taxonomy_term_field_data', 'taxonomy_vocabulary'), 'real field' => 'fid', 'relationship' => array( 'title' => t('File'), @@ -225,7 +225,7 @@ public function getViewsData() { 'help' => t('A taxonomy term that is associated with this file, usually because this file is in a field on the taxonomy term.'), // Only provide this field/relationship/etc., // when the 'file_managed' base table is present. - 'skip base' => array('node', 'node_field_revision', 'users', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'), + 'skip base' => array('node_field_data', 'node_field_revision', 'users_field_data', 'comment_field_data', 'taxonomy_term_field_data', 'taxonomy_vocabulary'), 'real field' => 'id', 'relationship' => array( 'title' => t('Taxonomy Term'), @@ -241,40 +241,7 @@ public function getViewsData() { 'help' => t('A file that is associated with this taxonomy term, usually because it is in a field on the taxonomy term.'), // Only provide this field/relationship/etc., // when the 'taxonomy_term_data' base table is present. - 'skip base' => array('file_managed', 'node', 'node_field_revision', 'users', 'comment', 'taxonomy_vocabulary'), - 'real field' => 'fid', - 'relationship' => array( - 'title' => t('File'), - 'label' => t('File'), - 'base' => 'file_managed', - 'base field' => 'fid', - 'relationship field' => 'fid', - ), - ); - - // Describes relationships between files and taxonomy_vocabulary items. - $data['file_usage']['file_to_taxonomy_vocabulary'] = array( - 'title' => t('Taxonomy Vocabulary'), - 'help' => t('A taxonomy vocabulary that is associated with this file, usually because this file is in a field on the taxonomy vocabulary.'), - // Only provide this field/relationship/etc., - // when the 'file_managed' base table is present. - 'skip base' => array('node', 'node_field_revision', 'users', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'), - 'real field' => 'id', - 'relationship' => array( - 'title' => t('Taxonomy Vocabulary'), - 'label' => t('Taxonomy Vocabulary'), - 'base' => 'taxonomy_vocabulary', - 'base field' => 'vid', - 'relationship field' => 'id', - 'extra' => array(array('table' => 'file_usage', 'field' => 'type', 'operator' => '=', 'value' => 'taxonomy_vocabulary')), - ), - ); - $data['file_usage']['taxonomy_vocabulary_to_file'] = array( - 'title' => t('File'), - 'help' => t('A file that is associated with this taxonomy vocabulary, usually because it is in a field on the taxonomy vocabulary.'), - // Only provide this field/relationship/etc., - // when the 'taxonomy_vocabulary' base table is present. - 'skip base' => array('file_managed', 'node', 'node_field_revision', 'users', 'comment', 'taxonomy_term_data'), + 'skip base' => array('file_managed', 'node_field_data', 'node_field_revision', 'users_field_data', 'comment_field_data', 'taxonomy_vocabulary'), 'real field' => 'fid', 'relationship' => array( 'title' => t('File'), diff --git a/core/modules/node/src/NodeViewsData.php b/core/modules/node/src/NodeViewsData.php index 9ab5ddf..aa33abc 100644 --- a/core/modules/node/src/NodeViewsData.php +++ b/core/modules/node/src/NodeViewsData.php @@ -346,7 +346,7 @@ public function getViewsData() { // For other base tables, explain how we join. $data['node_access']['table']['join'] = array( - 'node' => array( + 'node_field_data' => array( 'left_field' => 'nid', 'field' => 'nid', ), @@ -379,11 +379,10 @@ public function getViewsData() { // Use a Views table alias to allow other modules to use this table too, // if they use the search index. $data['node_search_index']['table']['join'] = array( - 'node' => array( + 'node_field_data' => array( 'left_field' => 'nid', 'field' => 'sid', 'table' => 'search_index', - 'left_table' => 'node_field_data', 'extra' => "node_search_index.type = 'node_search' AND node_search_index.langcode = node_field_data.langcode", ) ); diff --git a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_contextual_links.yml b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_contextual_links.yml index f57640c..b25fafc 100644 --- a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_contextual_links.yml +++ b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_contextual_links.yml @@ -9,7 +9,7 @@ label: 'Contextual links' module: node description: '' tag: default -base_table: node +base_table: node_field_data base_field: nid core: 8.x display: @@ -82,7 +82,7 @@ display: field: nid id: nid relationship: none - table: node + table: node_field_data plugin_id: numeric entity_type: node entity_field: nid diff --git a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_field_filters.yml b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_field_filters.yml index 85465de..564867e 100644 --- a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_field_filters.yml +++ b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_field_filters.yml @@ -9,7 +9,7 @@ label: 'Test field filters' module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: 8.x display: diff --git a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_filter_node_uid_revision.yml b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_filter_node_uid_revision.yml index f34d663..8e7264b 100644 --- a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_filter_node_uid_revision.yml +++ b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_filter_node_uid_revision.yml @@ -9,7 +9,7 @@ label: test_filter_node_uid_revision module: views description: '' tag: default -base_table: node +base_table: node_field_data base_field: nid core: 8.0-dev display: @@ -24,7 +24,7 @@ display: fields: nid: id: nid - table: node + table: node_field_data field: nid plugin_id: node entity_type: node @@ -50,7 +50,7 @@ display: sorts: nid: id: nid - table: node + table: node_field_data field: nid order: ASC plugin_id: standard diff --git a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_language.yml b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_language.yml index c9ec769..581680f 100644 --- a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_language.yml +++ b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_language.yml @@ -9,7 +9,7 @@ label: 'Test language' module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: 8.x display: diff --git a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_bulk_form.yml b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_bulk_form.yml index 094f9ec..2e41114 100644 --- a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_bulk_form.yml +++ b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_bulk_form.yml @@ -8,7 +8,7 @@ label: '' module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: 8.x display: diff --git a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_revision_nid.yml b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_revision_nid.yml index 4c4c5fa..86166b2 100644 --- a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_revision_nid.yml +++ b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_revision_nid.yml @@ -8,7 +8,7 @@ label: null module: views description: '' tag: '' -base_table: node_revision +base_table: node_field_revision base_field: nid core: '8' display: @@ -17,28 +17,28 @@ display: relationships: nid: id: nid - table: node_revision + table: node_field_revision field: nid required: true plugin_id: standard fields: vid: id: vid - table: node_revision + table: node_field_revision field: vid plugin_id: standard entity_type: node entity_field: vid nid_1: - id: nid_1 - table: node_revision + id: node_field_revision + table: revision_data_table field: nid plugin_id: standard entity_type: node entity_field: nid nid: id: nid - table: node + table: node_field_data field: nid relationship: nid plugin_id: node @@ -47,7 +47,7 @@ display: arguments: nid: id: nid - table: node_revision + table: revision_data_table field: nid plugin_id: node_nid entity_type: node diff --git a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_revision_vid.yml b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_revision_vid.yml index dea39a7..74bdb5c 100644 --- a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_revision_vid.yml +++ b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_revision_vid.yml @@ -8,7 +8,7 @@ label: null module: views description: '' tag: '' -base_table: node_revision +base_table: node_field_revision base_field: nid core: '8' display: @@ -17,28 +17,28 @@ display: relationships: vid: id: vid - table: node_revision + table: node_field_revision field: vid required: true plugin_id: standard fields: vid: id: vid - table: node_revision + table: node_field_revision field: vid plugin_id: standard entity_type: node entity_field: vid nid_1: id: nid_1 - table: node_revision + table: node_field_revision field: nid plugin_id: standard entity_type: node entity_field: nid nid: id: nid - table: node + table: node_field_data field: nid relationship: vid plugin_id: node @@ -47,7 +47,7 @@ display: arguments: nid: id: nid - table: node_revision + table: node_field_revision field: nid plugin_id: node_nid entity_type: node diff --git a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_row_plugin.yml b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_row_plugin.yml index 3579def..7e76af9 100644 --- a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_row_plugin.yml +++ b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_row_plugin.yml @@ -9,7 +9,7 @@ label: test_node_row_plugin module: views description: '' tag: default -base_table: node +base_table: node_field_data base_field: nid core: '8' display: @@ -28,7 +28,7 @@ display: field: status group: 1 id: status - table: node + table: node_field_data value: true plugin_id: boolean entity_type: node diff --git a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_view.yml b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_view.yml index ac8e5df..3836f0c 100644 --- a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_view.yml +++ b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_view.yml @@ -9,7 +9,7 @@ label: test_node_view module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: 8.x display: @@ -72,7 +72,7 @@ display: fields: nid: id: nid - table: node + table: node_field_data field: nid relationship: none group_type: group diff --git a/core/modules/statistics/statistics.views.inc b/core/modules/statistics/statistics.views.inc index fe9a9e6..c3fdaa1 100644 --- a/core/modules/statistics/statistics.views.inc +++ b/core/modules/statistics/statistics.views.inc @@ -12,7 +12,7 @@ function statistics_views_data() { $data['node_counter']['table']['group'] = t('Content statistics'); $data['node_counter']['table']['join'] = array( - 'node' => array( + 'node_field_data' => array( 'left_field' => 'nid', 'field' => 'nid', ), diff --git a/core/modules/taxonomy/src/TermViewsData.php b/core/modules/taxonomy/src/TermViewsData.php index 3ffe280..5ebdab9 100644 --- a/core/modules/taxonomy/src/TermViewsData.php +++ b/core/modules/taxonomy/src/TermViewsData.php @@ -167,7 +167,7 @@ public function getViewsData() { 'left_field' => 'tid', 'field' => 'tid', ), - 'node' => array( + 'node_field_data' => array( // links directly to node via nid 'left_field' => 'nid', 'field' => 'nid', diff --git a/core/modules/tracker/tracker.views.inc b/core/modules/tracker/tracker.views.inc index 5747e62..b7e4b95 100644 --- a/core/modules/tracker/tracker.views.inc +++ b/core/modules/tracker/tracker.views.inc @@ -71,12 +71,12 @@ function tracker_views_data() { $data['tracker_user']['table']['group'] = t('Tracker - User'); $data['tracker_user']['table']['join'] = array( - 'node' => array( + 'node_field_data' => array( 'type' => 'INNER', 'left_field' => 'nid', 'field' => 'nid', ), - 'user' => array( + 'user_field_data' => array( 'type' => 'INNER', 'left_field' => 'uid', 'field' => 'uid', @@ -164,14 +164,14 @@ function tracker_views_data_alter(&$data) { 'help' => t('Display nodes only if a user posted the node or commented on the node.'), 'argument' => array( 'field' => 'uid', - 'name table' => 'users', + 'name table' => 'users_field_data', 'name field' => 'name', 'id' => 'tracker_user_uid', 'no group by' => TRUE, ), 'filter' => array( 'field' => 'uid', - 'name table' => 'users', + 'name table' => 'users_field_data', 'name field' => 'name', 'id' => 'tracker_user_uid' ), diff --git a/core/modules/user/src/UserViewsData.php b/core/modules/user/src/UserViewsData.php index 2553a5e..e524f5c 100644 --- a/core/modules/user/src/UserViewsData.php +++ b/core/modules/user/src/UserViewsData.php @@ -88,8 +88,8 @@ public function getViewsData() { $data['users_field_data']['mail']['help'] = t('Email address for a given user. This field is normally not shown to users, so be cautious when using it.'); $data['users_field_data']['mail']['field']['id'] = 'user_mail'; - $data['users']['langcode']['id'] = 'user_language'; - $data['users']['langcode']['help'] = t('Original language of the user information'); + $data['users_field_data']['langcode']['id'] = 'user_language'; + $data['users_field_data']['langcode']['help'] = t('Original language of the user information'); $data['users_field_data']['langcode']['help'] = t('Language of the translation of user information'); $data['users_field_data']['preferred_langcode']['title'] = t('Preferred language'); diff --git a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_access_perm.yml b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_access_perm.yml index 194d676..e66b30e 100644 --- a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_access_perm.yml +++ b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_access_perm.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/user/tests/modules/user_test_views/test_views/views.view.test_field_permission.yml b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_field_permission.yml index 4f7f6a3..a9090c0 100644 --- a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_field_permission.yml +++ b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_field_permission.yml @@ -8,7 +8,7 @@ label: null module: views description: '' tag: '' -base_table: users +base_table: users_field_data base_field: uid core: 8.x display: @@ -35,7 +35,7 @@ display: fields: uid: id: uid - table: users + table: users_field_data field: uid relationship: none group_type: group diff --git a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_filter_permission.yml b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_filter_permission.yml index a1daf8f..53c2355 100644 --- a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_filter_permission.yml +++ b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_filter_permission.yml @@ -8,7 +8,7 @@ label: null module: views description: '' tag: '' -base_table: users +base_table: users_field_data base_field: uid core: 8.x display: @@ -128,7 +128,7 @@ display: sorts: uid: id: uid - table: users + table: users_field_data field: uid relationship: none group_type: group diff --git a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_groupwise_user.yml b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_groupwise_user.yml index 4e90e9f..b4e9bb8 100644 --- a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_groupwise_user.yml +++ b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_groupwise_user.yml @@ -9,7 +9,7 @@ label: test_groupwise_user module: views description: '' tag: default -base_table: users +base_table: users_field_data base_field: uid core: 8.0-dev display: diff --git a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_plugin_argument_default_current_user.yml b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_plugin_argument_default_current_user.yml index b9f33de..a67b1fb 100644 --- a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_plugin_argument_default_current_user.yml +++ b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_plugin_argument_default_current_user.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/user/tests/modules/user_test_views/test_views/views.view.test_user_bulk_form.yml b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_bulk_form.yml index 80ea23c..db53601 100644 --- a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_bulk_form.yml +++ b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_bulk_form.yml @@ -8,7 +8,7 @@ label: '' module: views description: '' tag: '' -base_table: users +base_table: users_field_data base_field: uid core: 8.x display: @@ -39,7 +39,7 @@ display: sorts: uid: id: uid - table: users + table: users_field_data field: uid order: ASC plugin_id: user diff --git a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_changed.yml b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_changed.yml index 60b55d4..9ad34a3 100644 --- a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_changed.yml +++ b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_changed.yml @@ -8,7 +8,7 @@ label: '' module: views description: '' tag: '' -base_table: users +base_table: users_field_data base_field: nid core: '8' display: @@ -29,7 +29,7 @@ display: fields: name: id: uid - table: users + table: users_field_data field: uid entity_type: user entity_field: uid diff --git a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_data.yml b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_data.yml index d722152..eaf72e1 100644 --- a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_data.yml +++ b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_data.yml @@ -8,7 +8,7 @@ label: test_user_data module: views description: '' tag: '' -base_table: users +base_table: users_field_data base_field: uid core: 8.x display: @@ -112,7 +112,7 @@ display: uid: value: value: '2' - table: users + table: users_field_data field: uid id: uid expose: diff --git a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_name.yml b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_name.yml index 8674303..36a073e 100644 --- a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_name.yml +++ b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_name.yml @@ -8,7 +8,7 @@ label: '' module: views description: '' tag: '' -base_table: users +base_table: users_field_data base_field: nid core: '8' display: @@ -29,14 +29,14 @@ display: fields: name: id: uid - table: users + table: users_field_data field: uid entity_type: user entity_field: uid filters: uid: id: uid - table: users + table: users_field_data field: uid exposed: true expose: diff --git a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_relationship.yml b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_relationship.yml index b7e6bc8..a2207e0 100644 --- a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_relationship.yml +++ b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_relationship.yml @@ -9,7 +9,7 @@ label: test_user_relationship module: views description: '' tag: default -base_table: node +base_table: node_field_data base_field: nid core: '8' display: @@ -91,7 +91,7 @@ display: hide_empty: false id: uid link_to_user: true - table: users + table: users_field_data plugin_id: user entity_type: user entity_field: uid diff --git a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_uid_argument.yml b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_uid_argument.yml index cf824cc..5551280 100644 --- a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_uid_argument.yml +++ b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_user_uid_argument.yml @@ -8,7 +8,7 @@ label: null module: views description: '' tag: '' -base_table: users +base_table: users_field_data base_field: nid core: '8' display: @@ -17,7 +17,7 @@ display: fields: uid: id: uid - table: users + table: users_field_data field: uid plugin_id: user entity_type: user @@ -25,7 +25,7 @@ display: arguments: uid: id: uid - table: users + table: users_field_data field: uid title_enable: true title: '%1' diff --git a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_view_argument_validate_user.yml b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_view_argument_validate_user.yml index 496afc6..ed2922c 100644 --- a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_view_argument_validate_user.yml +++ b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_view_argument_validate_user.yml @@ -6,7 +6,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/user/tests/modules/user_test_views/test_views/views.view.test_view_argument_validate_username.yml b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_view_argument_validate_username.yml index 3318782..a8f3718 100644 --- a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_view_argument_validate_username.yml +++ b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_view_argument_validate_username.yml @@ -6,7 +6,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/user/tests/modules/user_test_views/test_views/views.view.test_views_handler_field_role.yml b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_views_handler_field_role.yml index 4833b1c..fa31be5 100644 --- a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_views_handler_field_role.yml +++ b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_views_handler_field_role.yml @@ -8,7 +8,7 @@ label: test_views_handler_field_role module: views description: '' tag: '' -base_table: users +base_table: users_field_data base_field: uid core: 8.x display: diff --git a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_views_handler_field_user_name.yml b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_views_handler_field_user_name.yml index fe75705..4fd758c 100644 --- a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_views_handler_field_user_name.yml +++ b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_views_handler_field_user_name.yml @@ -8,7 +8,7 @@ label: test_views_handler_field_user_name module: views description: '' tag: default -base_table: users +base_table: users_field_data base_field: nid core: '8' display: diff --git a/core/modules/views/src/EntityViewsData.php b/core/modules/views/src/EntityViewsData.php index 9ff52ec..2ada727 100644 --- a/core/modules/views/src/EntityViewsData.php +++ b/core/modules/views/src/EntityViewsData.php @@ -491,11 +491,6 @@ protected function processViewsDataForTextLong($table, FieldDefinitionInterface /** * Gets the table of an entity type to be used as base table in views. * - * @todo Given that the base_table is pretty much useless as you often have to - * join to the data table anyway, it could make a lot of sense to start with - * the data table right from the beginning. - * @see https://drupal.org/node/2337509 - * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type. * @@ -503,7 +498,7 @@ protected function processViewsDataForTextLong($table, FieldDefinitionInterface * The name of the base table in views. */ protected function getViewsTableForEntityType(EntityTypeInterface $entity_type) { - return $entity_type->getBaseTable(); + return $entity_type->getDataTable() ?: $entity_type->getBaseTable(); } } diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_access_none.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_access_none.yml index 0c49729..292175c 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_access_none.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_access_none.yml @@ -6,7 +6,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/views/tests/modules/views_test_config/test_views/views.view.test_alias.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_alias.yml index dcf6e1d..092ca13 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_alias.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_alias.yml @@ -8,7 +8,7 @@ label: test_alias module: views description: '' tag: default -base_table: users +base_table: users_field_data base_field: nid core: 8.0-dev display: diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_argument_dependency.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_argument_dependency.yml index 9b8ac57..794dac8 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_argument_dependency.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_argument_dependency.yml @@ -17,7 +17,7 @@ label: test_argument_dependency 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/modules/views_test_config/test_views/views.view.test_destroy.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_destroy.yml index 5661a18..d7e4c2a 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_destroy.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_destroy.yml @@ -10,7 +10,7 @@ label: '' module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: '8' display: @@ -68,7 +68,7 @@ display: nid: field: nid id: nid - table: node + table: node_field_data plugin_id: node entity_type: node entity_field: nid @@ -82,7 +82,7 @@ display: nid: field: nid id: nid - table: node + table: node_field_data plugin_id: numeric entity_type: node entity_field: nid diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_disabled_display.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_disabled_display.yml index 352f0fb..711eefd 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_disabled_display.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_disabled_display.yml @@ -11,7 +11,7 @@ label: test_disabled_display 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/modules/views_test_config/test_views/views.view.test_display.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml index 4358c39..2208a66 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml @@ -9,7 +9,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/views/tests/modules/views_test_config/test_views/views.view.test_display_feed.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_feed.yml index a88f655..e34e6d8 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_feed.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_feed.yml @@ -9,7 +9,7 @@ label: test_display_feed module: views description: '' tag: default -base_table: node +base_table: node_field_data base_field: nid core: '8' display: diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_invalid.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_invalid.yml index 3d10813..ad2da89 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_invalid.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_invalid.yml @@ -8,7 +8,7 @@ label: '' module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: '8' display: @@ -19,7 +19,7 @@ display: fields: id: id: nid - table: node + table: node_field_data field: nid plugin_id: numeric entity_type: node diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_dropbutton.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_dropbutton.yml index 1b6ca39..16e8889 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_dropbutton.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_dropbutton.yml @@ -9,7 +9,7 @@ label: test_dropbutton module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: 8.x display: @@ -38,7 +38,7 @@ display: fields: nid: id: nid - table: node + table: node_field_data field: nid plugin_id: node relationship: none diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_row.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_row.yml index d0e1e7f..0c1a69b 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_row.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_row.yml @@ -6,7 +6,7 @@ label: '' module: views description: '' tag: '' -base_table: taxonomy_term_data +base_table: taxonomy_term_field_data base_field: nid core: '8' display: diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_row_renderers.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_row_renderers.yml index edf5b71..d9e80d7 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_row_renderers.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_row_renderers.yml @@ -10,7 +10,7 @@ label: '' 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/modules/views_test_config/test_views/views.view.test_entity_type_filter.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_type_filter.yml index 24b6430..ef2e0b3 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_type_filter.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_type_filter.yml @@ -8,7 +8,7 @@ label: '' module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: '8' display: @@ -21,7 +21,7 @@ display: fields: nid: id: nid - table: node + table: node_field_data field: nid relationship: none entity_type: node diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_example_area.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_example_area.yml index a8b6f8d..7f3acd9 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_example_area.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_example_area.yml @@ -5,7 +5,7 @@ id: test_example_area module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: '8' display: diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_example_area_access.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_example_area_access.yml index d92e672..5aab81c 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_example_area_access.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_example_area_access.yml @@ -5,7 +5,7 @@ id: test_example_area_access module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: '8' display: diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_admin_ui.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_admin_ui.yml index 280c930..a8d0c7a 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_admin_ui.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_admin_ui.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/views/tests/modules/views_test_config/test_views/views.view.test_exposed_block.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_block.yml index 35050a1..1cc9f44 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_block.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_block.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/views/tests/modules/views_test_config/test_views/views.view.test_exposed_form_buttons.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_form_buttons.yml index d3bc4c5..f0e110f 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_form_buttons.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_form_buttons.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/views/tests/modules/views_test_config/test_views/views.view.test_field_get_entity.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_field_get_entity.yml index 55bf2a2..b228a1d 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_field_get_entity.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_field_get_entity.yml @@ -10,7 +10,7 @@ label: test_field_get_entity module: views description: '' tag: default -base_table: comment +base_table: comment_field_data base_field: nid core: 8.0-dev display: @@ -26,14 +26,14 @@ display: cid: field: cid id: cid - table: comment + table: comment_field_data plugin_id: comment entity_type: comment entity_field: cid nid: field: nid id: nid - table: node + table: node_field_data relationship: node plugin_id: node entity_type: node diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_filter_group_override.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_filter_group_override.yml index 13e9e8f..1fb95ac 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_filter_group_override.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_filter_group_override.yml @@ -9,7 +9,7 @@ label: test_filter_group_override module: views description: '' tag: default -base_table: node +base_table: node_field_data base_field: nid core: '8' display: diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_filter_groups.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_filter_groups.yml index 936b849..2e5fa8e 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_filter_groups.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_filter_groups.yml @@ -9,7 +9,7 @@ label: test_filter_groups module: views description: '' tag: default -base_table: node +base_table: node_field_data base_field: nid core: '8' display: @@ -42,7 +42,7 @@ display: field: nid group: 2 id: nid - table: node + table: node_field_data value: value: '1' plugin_id: numeric @@ -52,7 +52,7 @@ display: field: nid group: 2 id: nid_1 - table: node + table: node_field_data value: value: '2' plugin_id: numeric @@ -107,7 +107,7 @@ display: field: nid group: 2 id: nid - table: node + table: node_field_data value: value: '1' plugin_id: numeric @@ -117,7 +117,7 @@ display: field: nid group: 2 id: nid_1 - table: node + table: node_field_data value: value: '2' plugin_id: numeric diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_filter_in_operator_ui.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_filter_in_operator_ui.yml index 0e97477..cf0d1b0 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_filter_in_operator_ui.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_filter_in_operator_ui.yml @@ -6,8 +6,7 @@ label: '' module: views description: '' tag: '' -base_table: node -base_field: nid +base_table: node_field_data core: '8' display: default: diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_get_attach_displays.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_get_attach_displays.yml index b07ee55..2465cd1 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_get_attach_displays.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_get_attach_displays.yml @@ -9,7 +9,7 @@ label: test_get_attach_displays module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: 8.x display: @@ -61,7 +61,7 @@ display: filters: status: value: true - table: node + table: node_field_data field: status id: status plugin_id: boolean @@ -73,7 +73,7 @@ display: sorts: created: id: created - table: node + table: node_field_data field: created order: DESC plugin_id: date diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_glossary.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_glossary.yml index 716dbfb..7dde87c 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_glossary.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_glossary.yml @@ -9,7 +9,7 @@ label: test_glossary module: views description: '' tag: default -base_table: node +base_table: node_field_data base_field: nid core: '8' display: diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_group_rows.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_group_rows.yml index a3c350c..71669eb 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_group_rows.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_group_rows.yml @@ -9,7 +9,7 @@ label: test_group_rows 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/modules/views_test_config/test_views/views.view.test_groupwise_term_ui.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_groupwise_term_ui.yml index 43f5464..1630bc3 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_groupwise_term_ui.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_groupwise_term_ui.yml @@ -10,7 +10,7 @@ label: test_groupwise module: views description: '' tag: default -base_table: taxonomy_term_data +base_table: taxonomy_term_field_data base_field: tid core: 8.0-dev display: @@ -34,7 +34,7 @@ display: field: nid id: nid relationship: tid_representative - table: node + table: node_field_data plugin_id: node entity_type: node entity_field: nid @@ -55,7 +55,7 @@ display: subquery_namespace: '' subquery_order: DESC subquery_regenerate: false - subquery_sort: node.nid + subquery_sort: node_field_data.nid subquery_view: '' table: taxonomy_term_data plugin_id: groupwise_max @@ -66,7 +66,7 @@ display: field: tid id: tid order: DESC - table: taxonomy_term_data + table: taxonomy_term_field_data plugin_id: standard entity_type: taxonomy_term entity_field: tid diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_handler_relationships.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_handler_relationships.yml index 62e3069..740f123 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_handler_relationships.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_handler_relationships.yml @@ -8,7 +8,7 @@ label: '' module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: '8' display: @@ -25,7 +25,7 @@ display: relationships: comment_cid: id: comment_cid - table: node + table: node_field_data field: comment_cid plugin_id: standard nid: diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_http_status_code.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_http_status_code.yml index 3d31fb7..4600650 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_http_status_code.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_http_status_code.yml @@ -8,7 +8,7 @@ label: test_http_status_code module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: 8.x display: @@ -56,7 +56,7 @@ display: filters: status: value: true - table: node + table: node_field_data field: status id: status expose: @@ -68,7 +68,7 @@ display: sorts: created: id: created - table: node + table: node_field_data field: created order: DESC entity_type: node diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_mini_pager.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_mini_pager.yml index 4743186..e82101d 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_mini_pager.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_mini_pager.yml @@ -9,7 +9,7 @@ label: test_mini_pager module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: 8.x display: @@ -76,7 +76,7 @@ display: sorts: nid: id: nid - table: node + table: node_field_data field: nid plugin_id: standard order: ASC diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_pager_full.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_pager_full.yml index a347a76..36f54db 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_pager_full.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_pager_full.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/views/tests/modules/views_test_config/test_views/views.view.test_pager_none.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_pager_none.yml index d72584d..6a4a388 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_pager_none.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_pager_none.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/views/tests/modules/views_test_config/test_views/views.view.test_pager_some.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_pager_some.yml index 2d432a7..c95172e 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_pager_some.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_pager_some.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/views/tests/modules/views_test_config/test_views/views.view.test_plugin_dependencies.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_plugin_dependencies.yml index c7818d2..b969ad5 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_plugin_dependencies.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_plugin_dependencies.yml @@ -13,7 +13,7 @@ label: test_plugin_dependencies module: views description: '' tag: default -base_table: comment +base_table: comment_field_data base_field: nid core: 8.0-dev display: @@ -29,7 +29,7 @@ display: cid: field: cid id: cid - table: comment + table: comment_field_data plugin_id: comment entity_type: comment entity_field: cid diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_redirect_view.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_redirect_view.yml index b3272bb..c4c5c6c 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_redirect_view.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_redirect_view.yml @@ -9,7 +9,7 @@ label: test_redirect_view 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/modules/views_test_config/test_views/views.view.test_relationship_dependency.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_relationship_dependency.yml index 6b05cf1..97e217e 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_relationship_dependency.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_relationship_dependency.yml @@ -10,7 +10,7 @@ label: test_relationship_dependency module: views description: '' tag: default -base_table: comment +base_table: comment_field_data base_field: nid core: 8.0-dev display: @@ -26,7 +26,7 @@ display: cid: field: cid id: cid - table: comment + table: comment_field_data plugin_id: comment entity_type: comment entity_field: cid diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_search.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_search.yml index bc86687..6495dcd 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_search.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_search.yml @@ -9,7 +9,7 @@ label: 'Search Test' module: views description: 'Test view for Search integration' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: 8.x display: diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_store_pager_settings.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_store_pager_settings.yml index 0be4da4..7dda22d 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_store_pager_settings.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_store_pager_settings.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/views/tests/modules/views_test_config/test_views/views.view.test_tag_cache.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_tag_cache.yml index 79ab084..47df910 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_tag_cache.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_tag_cache.yml @@ -8,7 +8,7 @@ label: '' module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: '8' display: @@ -35,7 +35,7 @@ display: group_type: group hide_empty: false id: nid - table: node + table: node_field_data plugin_id: numeric entity_type: node entity_field: nid diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_view_argument_validate_numeric.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_view_argument_validate_numeric.yml index 015262f..6465003 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_view_argument_validate_numeric.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_view_argument_validate_numeric.yml @@ -6,7 +6,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/views/tests/modules/views_test_config/test_views/views.view.test_view_delete.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_view_delete.yml index b1ad67d..2f8c5ad 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_view_delete.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_view_delete.yml @@ -6,7 +6,7 @@ label: test_view_delete module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: '8' display: diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_view_pager_full_zero_items_per_page.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_view_pager_full_zero_items_per_page.yml index ead31fd..75f0fd3 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_view_pager_full_zero_items_per_page.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_view_pager_full_zero_items_per_page.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/views/tests/modules/views_test_data/test_views/views.view.test_access_static.yml b/core/modules/views/tests/modules/views_test_data/test_views/views.view.test_access_static.yml index 270fd81..dc69203 100644 --- a/core/modules/views/tests/modules/views_test_data/test_views/views.view.test_access_static.yml +++ b/core/modules/views/tests/modules/views_test_data/test_views/views.view.test_access_static.yml @@ -10,7 +10,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/views/tests/src/Unit/EntityViewsDataTest.php b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php index cb2f0eb..f251b4d 100644 --- a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php +++ b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php @@ -403,7 +403,7 @@ public function testBaseTableFields() { $this->assertField($data['entity_test']['user_id'], 'user_id'); $relationship = $data['entity_test']['user_id']['relationship']; - $this->assertEquals('users', $relationship['base']); + $this->assertEquals('users_field_data', $relationship['base']); $this->assertEquals('uid', $relationship['base field']); } @@ -424,7 +424,7 @@ public function testDataTableFields() { ->setTranslatable(TRUE); $base_field_definitions = $this->setupBaseFields($base_field_definitions); $entity_test_type = new ConfigEntityType(['id' => 'entity_test_bundle']); - $user_entity_type = new ContentEntityType(['id' => 'user', 'base_table' => 'users', 'entity_keys' => ['id' => 'uid']]); + $user_entity_type = static::userEntityInfo(); $this->entityManager->expects($this->any()) ->method('getDefinition') ->willReturnMap([ @@ -512,7 +512,7 @@ public function testDataTableFields() { $this->assertEntityReferenceField($data['entity_test_mul_property_data']['user_id']); $this->assertField($data['entity_test_mul_property_data']['user_id'], 'user_id'); $relationship = $data['entity_test_mul_property_data']['user_id']['relationship']; - $this->assertEquals('users', $relationship['base']); + $this->assertEquals('users_field_data', $relationship['base']); $this->assertEquals('uid', $relationship['base field']); } @@ -623,7 +623,7 @@ public function testRevisionTableFields() { $this->assertEntityReferenceField($data['entity_test_mulrev_property_data']['user_id']); $this->assertField($data['entity_test_mulrev_property_data']['user_id'], 'user_id'); $relationship = $data['entity_test_mulrev_property_data']['user_id']['relationship']; - $this->assertEquals('users', $relationship['base']); + $this->assertEquals('users_field_data', $relationship['base']); $this->assertEquals('uid', $relationship['base field']); // Check the property data fields. @@ -647,7 +647,7 @@ public function testRevisionTableFields() { $this->assertEntityReferenceField($data['entity_test_mulrev_property_revision']['user_id']); $this->assertField($data['entity_test_mulrev_property_revision']['user_id'], 'user_id'); $relationship = $data['entity_test_mulrev_property_revision']['user_id']['relationship']; - $this->assertEquals('users', $relationship['base']); + $this->assertEquals('users_field_data', $relationship['base']); $this->assertEquals('uid', $relationship['base field']); } @@ -779,6 +779,7 @@ protected static function userEntityInfo() { 'class' => 'Drupal\user\Entity\User', 'label' => 'User', 'base_table' => 'users', + 'data_table' => 'users_field_data', 'entity_keys' => [ 'id' => 'uid', 'uuid' => 'uuid', diff --git a/core/modules/views/views.api.php b/core/modules/views/views.api.php index 2001c83..72a7fc5 100644 --- a/core/modules/views/views.api.php +++ b/core/modules/views/views.api.php @@ -183,7 +183,7 @@ function hook_views_data() { // for the other tables, given in their hook_views_data() implementations. // If the table listed here is from another module's hook_views_data() // implementation, make sure your module depends on that other module. - 'node' => array( + 'node_field_data' => array( // Primary key field in node to use in the join. 'left_field' => 'nid', // Foreign key field in example_table to use in the join. diff --git a/core/modules/views/views.views.inc b/core/modules/views/views.views.inc index 2037645..ea865e2 100644 --- a/core/modules/views/views.views.inc +++ b/core/modules/views/views.views.inc @@ -342,8 +342,7 @@ function views_field_default_views_data(FieldStorageConfigInterface $field_stora $table_alias = $field_tables[EntityStorageInterface::FIELD_LOAD_CURRENT]['alias']; if ($data_table) { // Tell Views how to join to the base table, via the data table. - $data[$table_alias]['table']['join'][$base_table] = array( - 'left_table' => $data_table, + $data[$table_alias]['table']['join'][$data_table] = array( 'left_field' => $entity_type->getKey('id'), 'field' => 'entity_id', 'extra' => array( @@ -367,8 +366,7 @@ function views_field_default_views_data(FieldStorageConfigInterface $field_stora $table_alias = $field_tables[EntityStorageInterface::FIELD_LOAD_REVISION]['alias']; if ($entity_revision_data_table) { // Tell Views how to join to the revision table, via the data table. - $data[$table_alias]['table']['join'][$entity_revision_table] = array( - 'left_table' => $entity_revision_data_table, + $data[$table_alias]['table']['join'][$entity_revision_data_table] = array( 'left_field' => $entity_type->getKey('revision'), 'field' => 'revision_id', 'extra' => array( diff --git a/core/modules/views_ui/tests/modules/views_ui_test/config/install/views.view.sa_contrib_2013_035.yml b/core/modules/views_ui/tests/modules/views_ui_test/config/install/views.view.sa_contrib_2013_035.yml index b81c6f1..272a6a2 100644 --- a/core/modules/views_ui/tests/modules/views_ui_test/config/install/views.view.sa_contrib_2013_035.yml +++ b/core/modules/views_ui/tests/modules/views_ui_test/config/install/views.view.sa_contrib_2013_035.yml @@ -9,7 +9,7 @@ label: SA_CONTRIB_2013_035 module: views description: '' tag: ', test' -base_table: node +base_table: node_field_data base_field: nid core: 8.x display: