diff --git a/core/modules/file/src/FileViewsData.php b/core/modules/file/src/FileViewsData.php index ec9685b..17a0138 100644 --- a/core/modules/file/src/FileViewsData.php +++ b/core/modules/file/src/FileViewsData.php @@ -77,28 +77,28 @@ public function getViewsData() { 'field' => 'fid', 'left_field' => 'fid', ), - // Link ourself to the {node} table + // Link ourself to the {node_field_data} table // so we can provide node->file relationships. 'node_field_data' => array( 'field' => 'id', 'left_field' => 'nid', 'extra' => array(array('field' => 'type', 'value' => 'node')), ), - // Link ourself to the {users} table + // Link ourself to the {users_field_data} table // so we can provide user->file relationships. 'users_field_data' => array( 'field' => 'id', 'left_field' => 'uid', 'extra' => array(array('field' => 'type', 'value' => 'user')), ), - // Link ourself to the {comment} table + // Link ourself to the {comment_field_data} table // so we can provide comment->file relationships. 'comment_field_data' => array( 'field' => 'id', 'left_field' => 'cid', 'extra' => array(array('field' => 'type', 'value' => 'comment')), ), - // Link ourself to the {taxonomy_term_data} table + // Link ourself to the {taxonomy_term_field_data} table // so we can provide taxonomy_term->file relationships. 'taxonomy_term_field_data' => array( 'field' => 'id', diff --git a/core/modules/user/src/UserViewsData.php b/core/modules/user/src/UserViewsData.php index a4a3881..b44345e 100644 --- a/core/modules/user/src/UserViewsData.php +++ b/core/modules/user/src/UserViewsData.php @@ -222,6 +222,9 @@ public function getViewsData() { ), ); + unset($data['users_field_data']['signature']); + unset($data['users_field_data']['signature_format']); + if (\Drupal::moduleHandler()->moduleExists('filter')) { $data['users_field_data']['signature'] = array( 'title' => t('Signature'), diff --git a/core/modules/views/src/EntityViewsData.php b/core/modules/views/src/EntityViewsData.php index d69c95d..1945cc3 100644 --- a/core/modules/views/src/EntityViewsData.php +++ b/core/modules/views/src/EntityViewsData.php @@ -184,7 +184,7 @@ public function getViewsData() { 'title' => $this->t('@entity_type revisions', array('@entity_type' => $this->entityType->getLabel())), ); // Join the revision table to the base table. - $data[$revision_table]['table']['join'][$views_base_table] = array( + $data[$views_revision_base_table]['table']['join'][$views_base_table] = array( 'left_field' => $revision_field, 'field' => $revision_field, 'type' => 'INNER', diff --git a/core/modules/views/src/Tests/FieldApiDataTest.php b/core/modules/views/src/Tests/FieldApiDataTest.php index 7aa96b9..18eb0e89 100644 --- a/core/modules/views/src/Tests/FieldApiDataTest.php +++ b/core/modules/views/src/Tests/FieldApiDataTest.php @@ -61,7 +61,7 @@ function testViewsData() { $this->assertTrue(isset($data[$current_table])); $this->assertTrue(isset($data[$revision_table])); - // The node field should join against node. + // The node field should join against node_field_data. $this->assertTrue(isset($data[$current_table]['table']['join']['node_field_data'])); $this->assertTrue(isset($data[$revision_table]['table']['join']['node_field_revision'])); diff --git a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php index e943f8a..b387e6b 100644 --- a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php +++ b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php @@ -260,12 +260,17 @@ public function testRevisionTableWithRevisionDataTableAndDataTable() { // Ensure the join information is set up properly. // Tests the join definition between the base and the revision table. - $revision_data = $data['entity_test_mulrev_revision']; - $this->assertCount(1, $revision_data['table']['join']); - $this->assertEquals(['entity_test_mul_property_data' => ['left_field' => 'revision_id', 'field' => 'revision_id', 'type' => 'INNER']], $revision_data['table']['join']); $revision_data = $data['entity_test_mulrev_property_revision']; - $this->assertCount(1, $revision_data['table']['join']); - $this->assertEquals(['entity_test_mulrev_revision' => ['left_field' => 'revision_id', 'field' => 'revision_id', 'type' => 'INNER']], $revision_data['table']['join']); + $this->assertCount(2, $revision_data['table']['join']); + $this->assertEquals([ + 'entity_test_mul_property_data' => [ + 'left_field' => 'revision_id', 'field' => 'revision_id', 'type' => 'INNER' + ], + 'entity_test_mulrev_revision' => [ + 'left_field' => 'revision_id', 'field' => 'revision_id', 'type' => 'INNER' + ], + ], $revision_data['table']['join']); + $this->assertFalse(isset($data['data_table'])); } @@ -293,12 +298,12 @@ public function testRevisionTableWithRevisionDataTable() { // Ensure the join information is set up properly. // Tests the join definition between the base and the revision table. - $revision_data = $data['entity_test_mulrev_revision']; - $this->assertCount(1, $revision_data['table']['join']); - $this->assertEquals(['entity_test' => ['left_field' => 'revision_id', 'field' => 'revision_id', 'type' => 'INNER']], $revision_data['table']['join']); $revision_data = $data['entity_test_mulrev_property_revision']; - $this->assertCount(1, $revision_data['table']['join']); - $this->assertEquals(['entity_test_mulrev_revision' => ['left_field' => 'revision_id', 'field' => 'revision_id', 'type' => 'INNER']], $revision_data['table']['join']); + $this->assertCount(2, $revision_data['table']['join']); + $this->assertEquals([ + 'entity_test' => ['left_field' => 'revision_id', 'field' => 'revision_id', 'type' => 'INNER'], + 'entity_test_mulrev_revision' => ['left_field' => 'revision_id', 'field' => 'revision_id', 'type' => 'INNER'], + ], $revision_data['table']['join']); $this->assertFalse(isset($data['data_table'])); }