diff --git a/core/modules/comment/config/optional/views.view.comments_recent.yml b/core/modules/comment/config/optional/views.view.comments_recent.yml index 585fab4..a15ecd1 100644 --- a/core/modules/comment/config/optional/views.view.comments_recent.yml +++ b/core/modules/comment/config/optional/views.view.comments_recent.yml @@ -65,6 +65,9 @@ display: table: comment_field_data field: subject relationship: none + type: string + settings: + link_to_entity: true plugin_id: field group_type: group admin_label: '' diff --git a/core/modules/comment/src/CommentViewsData.php b/core/modules/comment/src/CommentViewsData.php index e8fe404..2bf8384 100644 --- a/core/modules/comment/src/CommentViewsData.php +++ b/core/modules/comment/src/CommentViewsData.php @@ -33,7 +33,7 @@ public function getViewsData() { $data['comment_field_data']['name']['title'] = t('Author'); $data['comment_field_data']['name']['help'] = t("The name of the comment's author. Can be rendered as a link to the author's homepage."); - $data['comment_field_data']['name']['field']['id'] = 'field'; + $data['comment_field_data']['name']['field']['id'] = 'comment_username'; $data['comment_field_data']['homepage']['title'] = t("Author's website"); $data['comment_field_data']['homepage']['help'] = t("The website address of the comment's author. Can be rendered as a link. Will be empty if the author is a registered user."); diff --git a/core/modules/comment/src/Plugin/views/wizard/Comment.php b/core/modules/comment/src/Plugin/views/wizard/Comment.php index aa89369..35c3167 100644 --- a/core/modules/comment/src/Plugin/views/wizard/Comment.php +++ b/core/modules/comment/src/Plugin/views/wizard/Comment.php @@ -101,8 +101,9 @@ protected function defaultDisplayOptions() { $display_options['fields']['subject']['alter']['html'] = 0; $display_options['fields']['subject']['hide_empty'] = 0; $display_options['fields']['subject']['empty_zero'] = 0; - $display_options['fields']['subject']['link_to_comment'] = 1; - $display_options['fields']['subject']['plugin_id'] = 'comment'; + $display_options['fields']['subject']['plugin_id'] = 'field'; + $display_options['fields']['subject']['type'] = 'string'; + $display_options['fields']['subject']['settings'] = ['link_to_entity' => TRUE]; return $display_options; } diff --git a/core/modules/comment/src/Tests/Views/CommentRestExportTest.php b/core/modules/comment/src/Tests/Views/CommentRestExportTest.php index 8cc432d..ecf1a54 100644 --- a/core/modules/comment/src/Tests/Views/CommentRestExportTest.php +++ b/core/modules/comment/src/Tests/Views/CommentRestExportTest.php @@ -45,6 +45,9 @@ protected function setUp() { ); $this->comment = entity_create('comment', $comment); $this->comment->save(); + + $user = $this->drupalCreateUser(['access comments']); + $this->drupalLogin($user); } diff --git a/core/modules/comment/src/Tests/Views/DefaultViewRecentCommentsTest.php b/core/modules/comment/src/Tests/Views/DefaultViewRecentCommentsTest.php index 2b0f557..eaced4a 100644 --- a/core/modules/comment/src/Tests/Views/DefaultViewRecentCommentsTest.php +++ b/core/modules/comment/src/Tests/Views/DefaultViewRecentCommentsTest.php @@ -119,7 +119,7 @@ public function testBlockDisplay() { $map = array( 'comment_field_data_entity_id' => 'entity_id', - 'comment_field_data_subject' => 'subject', + 'subject' => 'subject', 'cid' => 'cid', 'comment_field_data_created' => 'created' ); diff --git a/core/modules/comment/src/Tests/Views/WizardTest.php b/core/modules/comment/src/Tests/Views/WizardTest.php index 3d9c730..d27098c 100644 --- a/core/modules/comment/src/Tests/Views/WizardTest.php +++ b/core/modules/comment/src/Tests/Views/WizardTest.php @@ -78,6 +78,9 @@ public function testCommentWizard() { $this->drupalPostForm(NULL, $view, t('Save and edit')); $this->assertUrl('admin/structure/views/view/' . $view['id'], array(), 'Make sure the view saving was successful and the browser got redirected to the edit page.'); + $user = $this->drupalCreateUser(['access comments']); + $this->drupalLogin($user); + $view = Views::getView($view['id']); $view->initHandlers(); $row = $view->display_handler->getOption('row'); 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 df90ea0..d9a2d26 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 @@ -85,7 +85,7 @@ display: table: comment_field_data field: node required: true - plugin_id: field + plugin_id: standard relationship: none group_type: group admin_label: Content @@ -140,8 +140,9 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - link_to_comment: true - link_to_entity: false + type: string + settings: + link_to_entity: false plugin_id: field name: id: name @@ -194,7 +195,7 @@ display: empty_zero: false hide_alter_empty: true link_to_user: false - plugin_id: field + plugin_id: comment_username created: id: created table: comment_field_data @@ -328,7 +329,7 @@ display: label: '' entity_type: comment entity_field: cid - plugin_id: field + plugin_id: standard header: { } footer: { } empty: { } 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 bc38d43..f6588b8 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 @@ -98,7 +98,6 @@ display: html: false hide_empty: false empty_zero: false - link_to_comment: true relationship: none group_type: group admin_label: '' @@ -113,7 +112,9 @@ display: element_default_classes: true empty: '' hide_alter_empty: true - link_to_entity: false + type: string + settings: + link_to_entity: true plugin_id: field entity_type: comment entity_field: subject diff --git a/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_rss.yml b/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_rss.yml index e559770..7fb1644 100644 --- a/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_rss.yml +++ b/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_rss.yml @@ -58,7 +58,9 @@ display: html: false hide_empty: false empty_zero: false - link_to_comment: true + type: string + settings: + link_to_entity: true entity_type: comment entity_field: subject filters: { } 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 5f4566f..60f6554 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 @@ -83,7 +83,6 @@ display: html: false hide_empty: false empty_zero: false - link_to_comment: true relationship: none group_type: group admin_label: '' @@ -98,7 +97,9 @@ display: element_default_classes: true empty: '' hide_alter_empty: true - link_to_entity: false + type: string + settings: + link_to_entity: false plugin_id: field entity_type: comment entity_field: subject diff --git a/core/modules/views/src/Tests/Entity/FieldEntityTest.php b/core/modules/views/src/Tests/Entity/FieldEntityTest.php index 770f7f0..404434f 100644 --- a/core/modules/views/src/Tests/Entity/FieldEntityTest.php +++ b/core/modules/views/src/Tests/Entity/FieldEntityTest.php @@ -67,6 +67,9 @@ public function testGetEntity() { )); $comment->save(); + $user = $this->drupalCreateUser(['access comments']); + $this->drupalLogin($user); + $view = Views::getView('test_field_get_entity'); $this->executeView($view); $row = $view->result[0]; 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 7e20ee7..3613335 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 @@ -27,7 +27,7 @@ display: field: cid id: cid table: comment_field_data - plugin_id: comment + plugin_id: field entity_type: comment entity_field: cid nid: