diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/row/CommentRow.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/row/CommentRow.php index 58316b6..4ccc754 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/row/CommentRow.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/row/CommentRow.php @@ -46,7 +46,7 @@ function render($row) { if (!$this->options['links']) { unset($build['links']); } - return drupal_render($build); + return $build; } } diff --git a/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentRowTest.php b/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentRowTest.php new file mode 100644 index 0000000..e4b2065 --- /dev/null +++ b/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentRowTest.php @@ -0,0 +1,40 @@ + 'Comment: Row Plugin', + 'description' => 'Tests the comment row plugin.', + 'group' => 'Views module integration', + ); + } + + /** + * Test comment row. + */ + public function testCommentRow() { + $this->drupalGet('test-comment-row'); + + $result = $this->xpath('//article[contains(@class, "comment")]'); + $this->assertEqual(1, count($result), 'One rendered comment found.'); + } + +} 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 new file mode 100644 index 0000000..bec8907 --- /dev/null +++ b/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_row.yml @@ -0,0 +1,144 @@ +base_field: cid +base_table: comment +core: 8.x +description: '' +status: '1' +display: + default: + display_plugin: default + id: default + display_title: Master + position: '1' + display_options: + access: + type: perm + options: + perm: 'access content' + cache: + type: none + options: { } + query: + type: views_query + options: + disable_sql_rewrite: '0' + distinct: '0' + slave: '0' + query_comment: '' + query_tags: { } + exposed_form: + type: basic + options: + submit_button: Apply + reset_button: '0' + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: '1' + sort_asc_label: Asc + sort_desc_label: Desc + pager: + type: full + options: + items_per_page: '10' + offset: '0' + id: '0' + total_pages: '' + expose: + items_per_page: '0' + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 20, 40, 60' + items_per_page_options_all: '0' + items_per_page_options_all_label: '- All -' + offset: '0' + offset_label: Offset + tags: + previous: '‹ previous' + next: 'next ›' + first: '« first' + last: 'last »' + quantity: '9' + style: + type: default + row: + type: 'entity:comment' + options: + links: '1' + view_mode: full + relationships: + nid: + id: nid + table: comment + field: nid + required: '1' + relationship: none + group_type: group + admin_label: Content + fields: + subject: + id: subject + table: comment + field: subject + label: '' + alter: + alter_text: '0' + make_link: '0' + absolute: '0' + trim: '0' + word_boundary: '0' + ellipsis: '0' + strip_tags: '0' + html: '0' + hide_empty: '0' + empty_zero: '0' + link_to_comment: '1' + relationship: none + group_type: group + admin_label: '' + exclude: '0' + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: '1' + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: '1' + empty: '' + hide_alter_empty: '1' + link_to_node: '0' + filters: + status: + value: '1' + table: comment + field: status + id: status + expose: + operator: '0' + group: '1' + status_node: + value: '1' + table: node_field_data + field: status + relationship: nid + id: status_node + expose: + operator: '0' + group: '1' + sorts: { } + title: test_comment_row + header: { } + footer: { } + empty: { } + arguments: { } + page_1: + display_plugin: page + id: page_1 + display_title: Page + position: '1' + display_options: + path: test-comment-row +label: test_comment_row +module: views +id: test_comment_row +tag: '' +uuid: 86b00437-846d-40d8-9426-384bbe2c7c8e +langcode: en