diff --git a/core/modules/comment/comment.views.inc b/core/modules/comment/comment.views.inc index cdd7ec0..5e31876 100644 --- a/core/modules/comment/comment.views.inc +++ b/core/modules/comment/comment.views.inc @@ -26,7 +26,7 @@ function comment_views_data_alter(&$data) { continue; } $fields = \Drupal::service('comment.manager')->getFields($entity_type_id); - $base_table = $entity_type->getBaseTable(); + $base_table = $entity_type->getDataTable() ?: $entity_type->getBaseTable(); $args = array('@entity_type' => $entity_type_id); if ($fields) { diff --git a/core/modules/node/src/NodeViewsData.php b/core/modules/node/src/NodeViewsData.php index 5d77aac..57654b2 100644 --- a/core/modules/node/src/NodeViewsData.php +++ b/core/modules/node/src/NodeViewsData.php @@ -269,7 +269,7 @@ public function getViewsData() { // tables. It would be neat if this could be encoded in the base field // definition. $data['node_field_revision']['nid']['relationship']['id'] = 'standard'; - $data['node_field_revision']['nid']['relationship']['base'] = 'node'; + $data['node_field_revision']['nid']['relationship']['base'] = 'node_field_data'; $data['node_field_revision']['nid']['relationship']['base field'] = 'nid'; $data['node_field_revision']['nid']['relationship']['title'] = t('Content'); $data['node_field_revision']['nid']['relationship']['label'] = t('Get the actual content from a content revision.'); @@ -281,7 +281,7 @@ public function getViewsData() { ), 'relationship' => array( 'id' => 'standard', - 'base' => 'node', + 'base' => 'node_field_data', 'base field' => 'vid', 'title' => t('Content'), 'label' => t('Get the actual content from a content revision.'), diff --git a/core/modules/node/src/Tests/Views/RevisionRelationshipsTest.php b/core/modules/node/src/Tests/Views/RevisionRelationshipsTest.php index 1f862e9..e422d6e 100644 --- a/core/modules/node/src/Tests/Views/RevisionRelationshipsTest.php +++ b/core/modules/node/src/Tests/Views/RevisionRelationshipsTest.php @@ -48,8 +48,8 @@ public function testNodeRevisionRelationship() { $node_revision->save(); $column_map = array( 'vid' => 'vid', - 'node_revision_nid' => 'node_revision_nid', - 'node_node_revision_nid' => 'node_node_revision_nid', + 'node_field_revision_nid' => 'node_revision_nid', + 'node_field_data_node_field_revision_nid' => 'node_node_revision_nid', ); // Here should be two rows. diff --git a/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php b/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php index a49b4ec..a5e5650 100644 --- a/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php +++ b/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php @@ -117,7 +117,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); @@ -134,7 +134,7 @@ 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']), 'IN'); $query->addTag('term_access'); @@ -148,7 +148,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/TermViewsData.php b/core/modules/taxonomy/src/TermViewsData.php index b2a14fe..f65b499 100644 --- a/core/modules/taxonomy/src/TermViewsData.php +++ b/core/modules/taxonomy/src/TermViewsData.php @@ -54,7 +54,7 @@ public function getViewsData() { ), ); - $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'), @@ -66,7 +66,7 @@ public function getViewsData() { 'argument field' => 'tid', 'base' => 'node_field_data', 'field' => 'nid', - 'relationship' => 'node:term_node_tid' + 'relationship' => 'node_field_data:term_node_tid' ), ); @@ -202,14 +202,14 @@ public function getViewsData() { '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, ), ); diff --git a/core/modules/taxonomy/src/Tests/Views/RelationshipRepresentativeNodeTest.php b/core/modules/taxonomy/src/Tests/Views/RelationshipRepresentativeNodeTest.php index 3f0df58..d5592f2 100644 --- a/core/modules/taxonomy/src/Tests/Views/RelationshipRepresentativeNodeTest.php +++ b/core/modules/taxonomy/src/Tests/Views/RelationshipRepresentativeNodeTest.php @@ -29,7 +29,7 @@ class RelationshipRepresentativeNodeTest extends TaxonomyTestBase { 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_field_data_taxonomy_term_field_data_nid' => 'nid', 'tid' => 'tid'); $expected_result = array( array( 'nid' => $this->nodes[1]->id(), diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyTermViewTest.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyTermViewTest.php index 615ae43..7496a7a 100644 --- a/core/modules/taxonomy/src/Tests/Views/TaxonomyTermViewTest.php +++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyTermViewTest.php @@ -149,7 +149,7 @@ public function testTaxonomyTermView() { $tables = $query->getTables(); // Ensure that the join to node_field_data is not added by default. - $this->assertEqual(['node', 'taxonomy_index'], array_keys($tables)); + $this->assertEqual(['node_field_data', 'taxonomy_index'], array_keys($tables)); // Ensure that the filter to the language column is not there by default. $condition = $query->conditions(); // We only want to check the no. of conditions in the query. diff --git a/core/modules/taxonomy/taxonomy.views.inc b/core/modules/taxonomy/taxonomy.views.inc index fc7cc0b..3160ea1 100644 --- a/core/modules/taxonomy/taxonomy.views.inc +++ b/core/modules/taxonomy/taxonomy.views.inc @@ -11,13 +11,13 @@ * Implements hook_views_data_alter(). */ function taxonomy_views_data_alter(&$data) { - $data['node']['term_node_tid'] = array( + $data['node_field_data']['term_node_tid'] = array( 'title' => t('Taxonomy terms on node'), 'help' => t('Relate nodes to taxonomy terms, specifying which vocabulary or vocabularies to use. This relationship will cause duplicated records if there are multiple terms.'), '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'), @@ -28,7 +28,7 @@ function taxonomy_views_data_alter(&$data) { ), ); - $data['node']['term_node_tid_depth'] = array( + $data['node_field_data']['term_node_tid_depth'] = array( 'help' => t('Display content if it has the selected taxonomy terms, or children of the selected terms. Due to additional complexity, this has fewer options than the versions without depth.'), 'real field' => 'nid', 'argument' => array( @@ -42,7 +42,7 @@ function taxonomy_views_data_alter(&$data) { ), ); - $data['node']['term_node_tid_depth_modifier'] = array( + $data['node_field_data']['term_node_tid_depth_modifier'] = array( 'title' => t('Has taxonomy term ID depth modifier'), 'help' => t('Allows the "depth" for Taxonomy: Term ID (with depth) to be modified via an additional contextual filter value.'), 'argument' => array( diff --git a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.taxonomy_default_argument_test.yml b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.taxonomy_default_argument_test.yml index 3ebdcd3..5842b34 100644 --- a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.taxonomy_default_argument_test.yml +++ b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.taxonomy_default_argument_test.yml @@ -9,7 +9,7 @@ label: taxonomy_default_argument_test module: views description: '' tag: '' -base_table: taxonomy_term_data +base_table: taxonomy_term_field_data base_field: tid core: 8.x display: @@ -80,7 +80,7 @@ display: fields: name: id: name - table: taxonomy_term_data + table: taxonomy_term_field_data field: name label: '' alter: @@ -122,7 +122,7 @@ display: arguments: tid: id: tid - table: taxonomy_term_data + table: taxonomy_term_field_data field: tid relationship: none group_type: group diff --git a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_filter_taxonomy_index_tid.yml b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_filter_taxonomy_index_tid.yml index 674919b..7a9a7ee 100644 --- a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_filter_taxonomy_index_tid.yml +++ b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_filter_taxonomy_index_tid.yml @@ -10,7 +10,7 @@ label: test_filter_taxonomy_index_tid 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/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 e2eee61..d1a732a 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 @@ -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 @@ -57,7 +57,7 @@ display: subquery_regenerate: true subquery_sort: node.nid subquery_view: '' - table: taxonomy_term_data + table: taxonomy_term_field_data plugin_id: groupwise_max row: type: fields @@ -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/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 5b482c1..848f83e 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 @@ -10,7 +10,7 @@ label: test_taxonomy_node_term_data module: views description: '' tag: '' -base_table: node +base_table: node_field_data base_field: nid core: '8' display: @@ -29,7 +29,7 @@ display: number_of_records: 0 summary_options: items_per_page: 25 - table: taxonomy_term_data + table: taxonomy_term_field_data plugin_id: taxonomy entity_type: taxonomy_term entity_field: tid @@ -43,7 +43,7 @@ display: number_of_records: 0 summary_options: items_per_page: 25 - table: taxonomy_term_data + table: taxonomy_term_field_data plugin_id: taxonomy entity_type: taxonomy_term entity_field: tid @@ -60,14 +60,14 @@ display: field: term_node_tid id: term_node_tid admin_label: 'Term #1' - table: node + table: node_field_data vids: {} plugin_id: node_term_data term_node_tid_1: field: term_node_tid id: term_node_tid_1 admin_label: 'Term #2' - table: node + table: node_field_data vids: {} plugin_id: node_term_data sorts: @@ -75,7 +75,7 @@ display: field: nid id: nid order: DESC - table: node + table: node_field_data plugin_id: standard entity_type: node entity_field: nid diff --git a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_tid_field.yml b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_tid_field.yml index a818f4e..1d7562a 100644 --- a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_tid_field.yml +++ b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_tid_field.yml @@ -9,7 +9,7 @@ label: test_taxonomy_tid_field module: views description: '' tag: '' -base_table: taxonomy_term_data +base_table: taxonomy_term_field_data base_field: tid core: 8.x display: @@ -137,7 +137,7 @@ display: sorts: tid: id: tid - table: taxonomy_term_data + table: taxonomy_term_field_data field: tid relationship: none group_type: group diff --git a/core/modules/user/src/Tests/Views/HandlerFieldUserNameTest.php b/core/modules/user/src/Tests/Views/HandlerFieldUserNameTest.php index 4a1ca4e..3c0ef73 100644 --- a/core/modules/user/src/Tests/Views/HandlerFieldUserNameTest.php +++ b/core/modules/user/src/Tests/Views/HandlerFieldUserNameTest.php @@ -35,18 +35,19 @@ public function testUserName() { $this->executeView($view); $username = $view->result[0]->users_field_data_name = $this->randomMachineName(); - $view->result[0]->users_field_data_uid = 1; + $view->result[0]->uid = 1; $render = $view->field['name']->advancedRender($view->result[0]); + debug($render); $this->assertTrue(strpos($render, $username) !== FALSE, 'If link to user is checked the username should be part of the output.'); $this->assertTrue(strpos($render, 'user/1') !== FALSE, 'If link to user is checked the link to the user should appear as well.'); $view->field['name']->options['link_to_user'] = FALSE; $username = $view->result[0]->users_field_data_name = $this->randomMachineName(); - $view->result[0]->users_field_data_uid = 1; + $view->result[0]->uid = 1; $render = $view->field['name']->advancedRender($view->result[0]); $this->assertIdentical($render, $username, 'If the user is not linked the username should be printed out for a normal user.'); - $view->result[0]->users_field_data_uid = 0; + $view->result[0]->uid = 0; $anon_name = $this->config('user.settings')->get('anonymous'); $view->result[0]->users_field_data_name = ''; $render = $view->field['name']->advancedRender($view->result[0]); @@ -55,8 +56,9 @@ public function testUserName() { $view->field['name']->options['overwrite_anonymous'] = TRUE; $anon_name = $view->field['name']->options['anonymous_text'] = $this->randomMachineName(); $render = $view->field['name']->advancedRender($view->result[0]); + debug($render); $this->assertIdentical($render, $anon_name , 'For user0 it should use the configured anonymous text if overwrite_anonymous is checked.'); - $view->result[0]->users_field_data_uid = 1; + $view->result[0]->uid = 1; $render = $view->field['name']->advancedRender($view->result[0]); $this->assertNotIdentical($render, $anon_name , 'For registered user it should not use the configured anonymous text if overwrite_anonymous is checked.'); } diff --git a/core/modules/user/src/Tests/Views/RelationshipRepresentativeNodeTest.php b/core/modules/user/src/Tests/Views/RelationshipRepresentativeNodeTest.php index 6e63885..0af2b6e 100644 --- a/core/modules/user/src/Tests/Views/RelationshipRepresentativeNodeTest.php +++ b/core/modules/user/src/Tests/Views/RelationshipRepresentativeNodeTest.php @@ -29,7 +29,7 @@ class RelationshipRepresentativeNodeTest extends UserTestBase { public function testRelationship() { $view = Views::getView('test_groupwise_user'); $this->executeView($view); - $map = array('node_users_nid' => 'nid', 'uid' => 'uid'); + $map = array('node_field_data_users_field_data_nid' => 'nid', 'uid' => 'uid'); $expected_result = array( array( 'uid' => $this->users[1]->id(), diff --git a/core/modules/user/src/UserViewsData.php b/core/modules/user/src/UserViewsData.php index 66bf6c7..a4a3881 100644 --- a/core/modules/user/src/UserViewsData.php +++ b/core/modules/user/src/UserViewsData.php @@ -53,17 +53,17 @@ public function getViewsData() { ), ); - $data['users']['uid_representative'] = array( + $data['users_field_data']['uid_representative'] = array( 'relationship' => array( 'title' => t('Representative node'), 'label' => t('Representative node'), 'help' => t('Obtains a single representative node for each user, according to a chosen sort criterion.'), 'id' => 'groupwise_max', 'relationship field' => 'uid', - 'outer field' => 'users.uid', - 'argument table' => 'users', + 'outer field' => 'users_field_data.uid', + 'argument table' => 'users_field_data', 'argument field' => 'uid', - 'base' => 'node', + 'base' => 'node_field_data', 'field' => 'nid', 'relationship' => 'node_field_data:uid' ), @@ -222,9 +222,6 @@ public function getViewsData() { ), ); - unset($data['users']['signature']); - unset($data['users']['signature_format']); - if (\Drupal::moduleHandler()->moduleExists('filter')) { $data['users_field_data']['signature'] = array( 'title' => t('Signature'), 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 b4e9bb8..9b7c030 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 @@ -35,7 +35,7 @@ display: field: nid id: nid relationship: uid_representative - table: node + table: node_field_data plugin_id: node entity_type: node entity_field: nid @@ -70,7 +70,7 @@ display: subquery_regenerate: true subquery_sort: node.nid subquery_view: '' - table: users + table: users_field_data plugin_id: groupwise_max row: type: fields diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php index 267a423..0ab41c8 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -2567,10 +2567,12 @@ protected function buildRenderingLanguageOptions() { protected function isBaseTableTranslatable() { $view_base_table = $this->view->storage->get('base_table'); foreach (\Drupal::entityManager()->getDefinitions() as $entity_type) { - if ($entity_type->isTranslatable() && $base_table = $entity_type->getBaseTable()) { - if ($base_table === $view_base_table) { - return TRUE; - } + if ($entity_type->isTranslatable()) { + $base_table = $entity_type->getBaseTable(); + $data_table = $entity_type->getDataTable(); + $revision_table = $entity_type->getRevisionTable(); + $revision_data_table = $entity_type->getRevisionDataTable(); + return in_array($view_base_table, [$base_table, $data_table, $revision_table, $revision_data_table]); } } return FALSE; diff --git a/core/modules/views/src/Tests/FieldApiDataTest.php b/core/modules/views/src/Tests/FieldApiDataTest.php index 5519633..7aa96b9 100644 --- a/core/modules/views/src/Tests/FieldApiDataTest.php +++ b/core/modules/views/src/Tests/FieldApiDataTest.php @@ -66,7 +66,6 @@ function testViewsData() { $this->assertTrue(isset($data[$revision_table]['table']['join']['node_field_revision'])); $expected_join = array( - 'left_table' => 'node_field_data', 'left_field' => 'nid', 'field' => 'entity_id', 'extra' => array( @@ -76,7 +75,6 @@ function testViewsData() { ); $this->assertEqual($expected_join, $data[$current_table]['table']['join']['node_field_data']); $expected_join = array( - 'left_table' => 'node_field_revision', 'left_field' => 'vid', 'field' => 'revision_id', 'extra' => array( diff --git a/core/modules/views/src/Tests/Handler/HandlerAllTest.php b/core/modules/views/src/Tests/Handler/HandlerAllTest.php index 7306c13..89339c9 100644 --- a/core/modules/views/src/Tests/Handler/HandlerAllTest.php +++ b/core/modules/views/src/Tests/Handler/HandlerAllTest.php @@ -63,8 +63,8 @@ public function testHandlers() { $view = $view->getExecutable(); // @todo The groupwise relationship is currently broken. - $exclude[] = 'taxonomy_term_data:tid_representative'; - $exclude[] = 'users:uid_representative'; + $exclude[] = 'taxonomy_term_field_data:tid_representative'; + $exclude[] = 'users_field_data:uid_representative'; // Go through all fields and there through all handler types. foreach ($info as $field => $field_info) { diff --git a/core/modules/views/src/Tests/Handler/HandlerTest.php b/core/modules/views/src/Tests/Handler/HandlerTest.php index 1abb773..4904baf 100644 --- a/core/modules/views/src/Tests/Handler/HandlerTest.php +++ b/core/modules/views/src/Tests/Handler/HandlerTest.php @@ -272,7 +272,7 @@ public function testRelationshipUI() { $this->assertNoFieldByName($relationship_name, NULL, 'Make sure that no relationship option is available'); // Create a view of comments with node relationship. - View::create(['base_table' => 'comment', 'id' => 'test_get_entity_type'])->save(); + View::create(['base_table' => 'comment_field_data', 'id' => 'test_get_entity_type'])->save(); $this->drupalPostForm('admin/structure/views/nojs/add-handler/test_get_entity_type/default/relationship', ['name[comment_field_data.node]' => 'comment_field_data.node'], t('Add and configure relationships')); $this->drupalPostForm(NULL, [], t('Apply')); // Add a content type filter. diff --git a/core/modules/views/src/Tests/Handler/RelationshipTest.php b/core/modules/views/src/Tests/Handler/RelationshipTest.php index d361a39..36f608b 100644 --- a/core/modules/views/src/Tests/Handler/RelationshipTest.php +++ b/core/modules/views/src/Tests/Handler/RelationshipTest.php @@ -33,7 +33,7 @@ class RelationshipTest extends RelationshipJoinTestBase { */ protected $columnMap = array( 'views_test_data_name' => 'name', - 'users_views_test_data_uid' => 'uid', + 'users_field_data_views_test_data_uid' => 'uid', ); /** @@ -58,7 +58,7 @@ public function testRelationshipQuery() { $view->displayHandlers->get('default')->overrideOption('filters', array( 'uid' => array( 'id' => 'uid', - 'table' => 'users', + 'table' => 'users_field_data', 'field' => 'uid', 'relationship' => 'uid', ), @@ -68,7 +68,7 @@ public function testRelationshipQuery() { $view->displayHandlers->get('default')->overrideOption('fields', $fields + array( 'uid' => array( 'id' => 'uid', - 'table' => 'users', + 'table' => 'users_field_data', 'field' => 'uid', 'relationship' => 'uid', ), diff --git a/core/modules/views/src/Tests/Plugin/JoinTest.php b/core/modules/views/src/Tests/Plugin/JoinTest.php index 28dbc4c..e8fd85d 100644 --- a/core/modules/views/src/Tests/Plugin/JoinTest.php +++ b/core/modules/views/src/Tests/Plugin/JoinTest.php @@ -55,7 +55,7 @@ public function testExamplePlugin() { $configuration = array( 'left_table' => 'views_test_data', 'left_field' => 'uid', - 'table' => 'users', + 'table' => 'users_field_data', 'field' => 'uid', ); $join = $this->manager->createInstance('join_test', $configuration); @@ -65,11 +65,11 @@ public function testExamplePlugin() { $join->setJoinValue($rand_int); $query = db_select('views_test_data'); - $table = array('alias' => 'users'); + $table = array('alias' => 'users_field_data'); $join->buildJoin($query, $table, $view->query); $tables = $query->getTables(); - $join_info = $tables['users']; + $join_info = $tables['users_field_data']; $this->assertTrue(strpos($join_info['condition'], "views_test_data.uid = $rand_int") !== FALSE, 'Make sure that the custom join plugin can extend the join base and alter the result.'); } @@ -88,7 +88,7 @@ public function testBasePlugin() { $configuration = array( 'left_table' => 'views_test_data', 'left_field' => 'uid', - 'table' => 'users', + 'table' => 'users_field_data', 'field' => 'uid', 'adjusted' => TRUE, ); @@ -100,15 +100,15 @@ public function testBasePlugin() { // Build the actual join values and read them back from the dbtng query // object. $query = db_select('views_test_data'); - $table = array('alias' => 'users'); + $table = array('alias' => 'users_field_data'); $join->buildJoin($query, $table, $view->query); $tables = $query->getTables(); - $join_info = $tables['users']; + $join_info = $tables['users_field_data']; $this->assertEqual($join_info['join type'], 'LEFT', 'Make sure the default join type is LEFT'); $this->assertEqual($join_info['table'], $configuration['table']); - $this->assertEqual($join_info['alias'], 'users'); - $this->assertEqual($join_info['condition'], 'views_test_data.uid = users.uid'); + $this->assertEqual($join_info['alias'], 'users_field_data'); + $this->assertEqual($join_info['condition'], 'views_test_data.uid = users_field_data.uid'); // Set a different alias and make sure table info is as expected. $join = $this->manager->createInstance('standard', $configuration); diff --git a/core/modules/views/src/Tests/Plugin/RelationshipJoinTestBase.php b/core/modules/views/src/Tests/Plugin/RelationshipJoinTestBase.php index 83fb1cf..b85c235 100644 --- a/core/modules/views/src/Tests/Plugin/RelationshipJoinTestBase.php +++ b/core/modules/views/src/Tests/Plugin/RelationshipJoinTestBase.php @@ -49,7 +49,7 @@ protected function schemaDefinition() { $schema = parent::schemaDefinition(); $schema['views_test_data']['fields']['uid'] = array( - 'description' => "The {users}.uid of the author of the beatle entry.", + 'description' => "The {users_field_data}.uid of the author of the beatle entry.", 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, @@ -71,7 +71,7 @@ protected function viewsData() { 'help' => t('The test data UID'), 'relationship' => array( 'id' => 'standard', - 'base' => 'users', + 'base' => 'users_field_data', 'base field' => 'uid' ) ); 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 1630bc3..09ca412 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 @@ -35,7 +35,7 @@ display: id: nid relationship: tid_representative table: node_field_data - plugin_id: node + plugin_id: node_field_data entity_type: node entity_field: nid pager: @@ -57,7 +57,7 @@ display: subquery_regenerate: false subquery_sort: node_field_data.nid subquery_view: '' - table: taxonomy_term_data + table: taxonomy_term_field_data plugin_id: groupwise_max row: type: fields diff --git a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php index e943f8a..827eb35 100644 --- a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php +++ b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php @@ -791,6 +791,8 @@ protected function assertEntityReferenceField($data) { $this->assertEquals('numeric', $data['filter']['id']); $this->assertEquals('numeric', $data['argument']['id']); $this->assertEquals('standard', $data['sort']['id']); + + $a = 123; } /** diff --git a/core/modules/views_ui/src/Form/Ajax/AddHandler.php b/core/modules/views_ui/src/Form/Ajax/AddHandler.php index 02d6e30..50476d6 100644 --- a/core/modules/views_ui/src/Form/Ajax/AddHandler.php +++ b/core/modules/views_ui/src/Form/Ajax/AddHandler.php @@ -81,6 +81,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { // Figure out all the base tables allowed based upon what the relationships provide. $base_tables = $executable->getBaseTables(); + debug(array_keys($base_tables)); + debug($type); $options = Views::viewsDataHelper()->fetchFields(array_keys($base_tables), $type, $display->useGroupBy(), $form_state->get('type')); if (!empty($options)) { diff --git a/core/modules/views_ui/src/Tests/HandlerTest.php b/core/modules/views_ui/src/Tests/HandlerTest.php index b376c16..4c9c786 100644 --- a/core/modules/views_ui/src/Tests/HandlerTest.php +++ b/core/modules/views_ui/src/Tests/HandlerTest.php @@ -56,7 +56,7 @@ protected function viewsData() { 'help' => t('The test data UID'), 'relationship' => array( 'id' => 'standard', - 'base' => 'users', + 'base' => 'users_field_data', 'base field' => 'uid' ) ); diff --git a/core/modules/views_ui/src/Tests/ViewEditTest.php b/core/modules/views_ui/src/Tests/ViewEditTest.php index 9048972..be9c487 100644 --- a/core/modules/views_ui/src/Tests/ViewEditTest.php +++ b/core/modules/views_ui/src/Tests/ViewEditTest.php @@ -29,7 +29,7 @@ class ViewEditTest extends UITestBase { /** * Tests the delete link on a views UI. */ - public function testDeleteLink() { + public function testsDeleteLink() { $this->drupalGet('admin/structure/views/view/test_view'); $this->assertLink(t('Delete view'), 0, 'Ensure that the view delete link appears'); @@ -48,7 +48,7 @@ public function testDeleteLink() { /** * Tests the machine name form. */ - public function testMachineNameOption() { + public function testsMachineNameOption() { $this->drupalGet('admin/structure/views/view/test_view'); // Add a new attachment display. $this->drupalPostForm(NULL, array(), 'Add Attachment'); @@ -142,7 +142,7 @@ public function testEditFormLanguageOptions() { /** * Tests Representative Node for a Taxonomy Term. */ - public function testRelationRepresentativeNode() { + public function testsRelationRepresentativeNode() { // Populate and submit the form. $edit["name[taxonomy_term_data.tid_representative]"] = TRUE; $this->drupalPostForm('admin/structure/views/nojs/add-handler/test_groupwise_term_ui/default/relationship', $edit, 'Add and configure relationships');