From d2478e96d27c714bce96f6bb72be546c83efd216 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Sun, 8 Dec 2013 06:28:36 -0400 Subject: [PATCH] Revert "Issue #2020395 by dawehner, oadaeh, mr.baileys, jibran, Andi-D: Convert 'Who's new' block to a View." This reverts commit f7e75db703461fc37858da332ef2d917afd1e93c. --- core/modules/comment/comment.install | 7 - core/modules/comment/comment.module | 27 + .../config/views.view.comments_recent.yml | 230 --------- .../Plugin/Block/RecentCommentsBlock.php | 72 +++ .../Drupal/comment/Tests/CommentBlockTest.php | 74 +-- .../Tests/Views/DefaultViewRecentComments.php | 38 +- .../user/config/views.view.who_s_new.yml | 165 ------- .../Drupal/user/Plugin/Block/UserNewBlock.php | 85 ++++ core/modules/user/user.module | 3 + .../config/views.view.comments_recent.yml | 466 ++++++++++++++++++ .../Drupal/views/Tests/DefaultViewsTest.php | 2 +- 11 files changed, 729 insertions(+), 440 deletions(-) delete mode 100644 core/modules/comment/config/views.view.comments_recent.yml create mode 100644 core/modules/comment/lib/Drupal/comment/Plugin/Block/RecentCommentsBlock.php delete mode 100644 core/modules/user/config/views.view.who_s_new.yml create mode 100644 core/modules/user/lib/Drupal/user/Plugin/Block/UserNewBlock.php create mode 100644 core/modules/views/config/views.view.comments_recent.yml diff --git a/core/modules/comment/comment.install b/core/modules/comment/comment.install index 90da95d77aec..ac3c3300e6e1 100644 --- a/core/modules/comment/comment.install +++ b/core/modules/comment/comment.install @@ -729,13 +729,6 @@ function comment_update_8008(&$sandbox) { db_drop_field('node_revision', 'comment'); } -/** - * Remove the comment_block_count variable. - */ -function comment_update_8009() { - variable_del('comment_block_count'); -} - /** * @} End of "addtogroup updates-7.x-to-8.x". * The next series of updates should start at 9000. diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index b2df4228fae2..bca41086fa40 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -173,6 +173,9 @@ function comment_field_extra_fields() { */ function comment_theme() { return array( + 'comment_block' => array( + 'variables' => array('number' => NULL), + ), 'comment_preview' => array( 'variables' => array('comment' => NULL), ), @@ -426,6 +429,30 @@ function comment_new_page_count($num_comments, $new_replies, EntityInterface $en return $pagenum; } +/** + * Returns HTML for a list of recent comments. + * + * @ingroup themeable + */ +function theme_comment_block($variables) { + $items = array(); + $number = $variables['number']; + foreach (comment_get_recent($number) as $comment) { + $items[] = l($comment->subject, 'comment/' . $comment->cid, array('fragment' => 'comment-' . $comment->cid)) . ' <span>' . t('@time ago', array('@time' => format_interval(REQUEST_TIME - $comment->changed))) . '</span>'; + } + + if ($items) { + $item_list = array( + '#theme' => 'item_list', + '#items' => $items, + ); + return drupal_render($item_list); + } + else { + return t('No comments available.'); + } +} + /** * Implements hook_entity_view(). */ diff --git a/core/modules/comment/config/views.view.comments_recent.yml b/core/modules/comment/config/views.view.comments_recent.yml deleted file mode 100644 index 7650bf4c0ad6..000000000000 --- a/core/modules/comment/config/views.view.comments_recent.yml +++ /dev/null @@ -1,230 +0,0 @@ -base_field: cid -base_table: comment -core: 8.x -description: 'Recent comments.' -status: true -display: - block_1: - display_plugin: block - id: block_1 - display_title: Block - position: 0 - display_options: - block_description: 'Recent comments' - block_category: Lists (Views) - default: - display_plugin: default - id: default - display_title: Master - position: 1 - display_options: - access: - type: perm - options: - perm: 'access comments' - cache: - type: none - query: - type: views_query - exposed_form: - type: basic - pager: - type: some - options: - items_per_page: 10 - offset: 0 - style: - type: html_list - options: - grouping: { } - row_class: '' - default_row_class: true - row_class_special: true - type: ul - wrapper_class: item-list - class: '' - row: - type: fields - options: - default_field_elements: true - inline: - subject: subject - changed: changed - separator: ' ' - hide_empty: false - relationships: - node: - field: node - id: node - table: comment - required: true - plugin_id: standard - fields: - subject: - id: subject - table: comment - field: subject - relationship: none - plugin_id: comment - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: '' - word_boundary: false - ellipsis: false - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - link_to_comment: true - link_to_node: false - changed: - id: changed - table: comment - field: changed - relationship: none - plugin_id: date - group_type: group - admin_label: '' - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: '' - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - date_format: 'time ago' - custom_date_format: '' - timezone: '' - filters: - status: - value: true - table: comment - field: status - id: status - plugin_id: boolean - expose: - operator: false - group: 1 - status_node: - value: true - table: node_field_data - field: status - relationship: node - id: status_node - plugin_id: boolean - expose: - operator: false - group: 1 - sorts: - created: - id: created - table: comment - field: created - relationship: none - group_type: group - admin_label: '' - order: DESC - exposed: false - expose: - label: '' - plugin_id: date - cid: - id: cid - table: comment - field: cid - relationship: none - group_type: group - admin_label: '' - order: DESC - exposed: false - expose: - label: '' - plugin_id: standard - title: 'Recent comments' - empty: - area_text_custom: - id: area_text_custom - table: views - field: area_text_custom - relationship: none - group_type: group - admin_label: '' - label: '' - empty: true - content: 'No comments available.' - tokenize: false - plugin_id: text_custom -label: 'Recent comments' -module: views -id: comments_recent -tag: default -langcode: en -uuid: 67212880-6a63-453b-a902-2d13580f7d1c diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/Block/RecentCommentsBlock.php b/core/modules/comment/lib/Drupal/comment/Plugin/Block/RecentCommentsBlock.php new file mode 100644 index 000000000000..d21c91b38a65 --- /dev/null +++ b/core/modules/comment/lib/Drupal/comment/Plugin/Block/RecentCommentsBlock.php @@ -0,0 +1,72 @@ +<?php + +/** + * @file + * Contains \Drupal\comment\Plugin\Block\RecentCommentsBlock. + */ + +namespace Drupal\comment\Plugin\Block; + +use Drupal\block\BlockBase; +use Drupal\block\Annotation\Block; +use Drupal\Core\Annotation\Translation; +use Drupal\Core\Session\AccountInterface; + +/** + * Provides a 'Recent comments' block. + * + * @Block( + * id = "recent_comments", + * admin_label = @Translation("Recent comments"), + * category = @Translation("Lists (Views)") + * ) + */ +class RecentCommentsBlock extends BlockBase { + + /** + * {@inheritdoc} + */ + public function defaultConfiguration() { + return array( + 'block_count' => 10, + ); + } + + /** + * {@inheritdoc} + */ + public function access(AccountInterface $account) { + return $account->hasPermission('access comments'); + } + + /** + * Overrides \Drupal\block\BlockBase::blockForm(). + */ + public function blockForm($form, &$form_state) { + $form['block_count'] = array( + '#type' => 'select', + '#title' => t('Number of recent comments'), + '#default_value' => $this->configuration['block_count'], + '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 30)), + ); + return $form; + } + + /** + * Overrides \Drupal\block\BlockBase::blockSubmit(). + */ + public function blockSubmit($form, &$form_state) { + $this->configuration['block_count'] = $form_state['values']['block_count']; + } + + /** + * {@inheritdoc} + */ + public function build() { + return array( + '#theme' => 'comment_block', + '#number' => $this->configuration['block_count'], + ); + } + +} diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentBlockTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentBlockTest.php index 9fa5ea8ae4bd..61ce22be6f5a 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentBlockTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentBlockTest.php @@ -6,7 +6,6 @@ */ namespace Drupal\comment\Tests; -use Drupal\Component\Utility\String; /** * Tests the Comment module blocks. @@ -18,7 +17,7 @@ class CommentBlockTest extends CommentTestBase { * * @var array */ - public static $modules = array('block', 'views'); + public static $modules = array('block'); function setUp() { parent::setUp(); @@ -47,18 +46,12 @@ public static function getInfo() { */ function testRecentCommentBlock() { $this->drupalLogin($this->admin_user); - $block = $this->drupalPlaceBlock('views_block:comments_recent-block_1'); - - // Add some test comments, with and without subjects. Because the 10 newest - // comments should be shown by the block, we create 11 to test that behavior - // below. - $timestamp = REQUEST_TIME; - for ($i = 0; $i < 11; ++$i) { - $subject = ($i % 2) ? $this->randomName() : ''; - $comments[$i] = $this->postComment($this->node, $this->randomName(), $subject); - $comments[$i]->created->value = $timestamp--; - $comments[$i]->save(); - } + $block = $this->drupalPlaceBlock('recent_comments', array('block_count' => 2)); + + // Add some test comments, one without a subject. + $comment1 = $this->postComment($this->node, $this->randomName(), $this->randomName()); + $comment2 = $this->postComment($this->node, $this->randomName(), $this->randomName()); + $comment3 = $this->postComment($this->node, $this->randomName()); // Test that a user without the 'access comments' permission cannot see the // block. @@ -68,35 +61,48 @@ function testRecentCommentBlock() { // posting a node from a node form. cache_invalidate_tags(array('content' => TRUE)); $this->drupalGet(''); - $this->assertNoText(t('Recent comments')); + $label = $block->label(); + $this->assertNoText($label, 'Block was not found.'); user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access comments')); // Test that a user with the 'access comments' permission can see the // block. $this->drupalLogin($this->web_user); $this->drupalGet(''); - $this->assertText(t('Recent comments')); - - // Test the only the 10 latest comments are shown and in the proper order. - $this->assertNoText($comments[10]->subject->value, 'Comment 11 not found in block.'); - for ($i = 0; $i < 10; $i++) { - $this->assertText($comments[$i]->subject->value, String::format('Comment @number found in block.', array('@number' => 10 - $i))); - if ($i > 1) { - $previous_position = $position; - $position = strpos($this->drupalGetContent(), $comments[$i]->subject->value); - $this->assertTrue($position > $previous_position, String::format('Comment @a appears after comment @b', array('@a' => 10 - $i, '@b' => 11 - $i))); - } - $position = strpos($this->drupalGetContent(), $comments[$i]->subject->value); - } + $this->assertText($label, 'Block was found.'); + + // Test the only the 2 latest comments are shown and in the proper order. + $this->assertNoText($comment1->subject->value, 'Comment not found in block.'); + $this->assertText($comment2->subject->value, 'Comment found in block.'); + $this->assertText($comment3->comment_body->value, 'Comment found in block.'); + $this->assertTrue(strpos($this->drupalGetContent(), $comment3->comment_body->value) < strpos($this->drupalGetContent(), $comment2->subject->value), 'Comments were ordered correctly in block.'); + + // Set the number of recent comments to show to 10. + $block->getPlugin()->setConfigurationValue('block_count', 10); + $block->save(); + + // Post an additional comment. + $comment4 = $this->postComment($this->node, $this->randomName(), $this->randomName()); + + // Test that all four comments are shown. + $this->assertText($comment1->subject->value, 'Comment found in block.'); + $this->assertText($comment2->subject->value, 'Comment found in block.'); + $this->assertText($comment3->comment_body->value, 'Comment found in block.'); + $this->assertText($comment4->subject->value, 'Comment found in block.'); // Test that links to comments work when comments are across pages. $this->setCommentsPerPage(1); - - for ($i = 0; $i < 10; $i++) { - $this->clickLink($comments[$i]->subject->value); - $this->assertText($comments[$i]->subject->value, 'Comment link goes to correct page.'); - $this->assertRaw('<link rel="canonical"', 'Canonical URL was found in the HTML head'); - } + $this->drupalGet(''); + $this->clickLink($comment1->subject->value); + $this->assertText($comment1->subject->value, 'Comment link goes to correct page.'); + $this->drupalGet(''); + $this->clickLink($comment2->subject->value); + $this->assertText($comment2->subject->value, 'Comment link goes to correct page.'); + $this->clickLink($comment4->subject->value); + $this->assertText($comment4->subject->value, 'Comment link goes to correct page.'); + // Check that when viewing a comment page from a link to the comment, that + // rel="canonical" is added to the head of the document. + $this->assertRaw('<link rel="canonical"', 'Canonical URL was found in the HTML head'); } } diff --git a/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php b/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php index 25c8c4df3bef..c2b59e22f87b 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php @@ -87,6 +87,8 @@ public function setUp() { 'entity_id' => $this->node->id(), )); $comment->uid->target_id = 0; + // Stagger the comments so the timestamp sorting works. + $comment->created->value = REQUEST_TIME - $i; $comment->subject->value = 'Test comment ' . $i; $comment->comment_body->value = 'Test body ' . $i; $comment->comment_body->format = 'full_html'; @@ -102,7 +104,7 @@ public function setUp() { // Store all the nodes just created to access their properties on the tests. $this->commentsCreated = entity_load_multiple('comment'); - // Sort created comments in descending order. + // Sort created comments in ascending order. ksort($this->commentsCreated, SORT_NUMERIC); } @@ -118,14 +120,14 @@ public function testBlockDisplay() { 'comment_entity_id' => 'entity_id', 'comment_subject' => 'subject', 'cid' => 'cid', - 'comment_created' => 'created' + 'comment_changed' => 'changed' ); $expected_result = array(); foreach (array_values($this->commentsCreated) as $key => $comment) { $expected_result[$key]['entity_id'] = $comment->entity_id->value; $expected_result[$key]['subject'] = $comment->subject->value; $expected_result[$key]['cid'] = $comment->id(); - $expected_result[$key]['created'] = $comment->created->value; + $expected_result[$key]['changed'] = $comment->changed->value; } $this->assertIdenticalResultset($view, $expected_result, $map); @@ -137,4 +139,34 @@ public function testBlockDisplay() { ); } + /** + * Tests the page defined by the comments_recent view. + */ + public function testPageDisplay() { + $view = views_get_view('comments_recent'); + $view->setDisplay('page_1'); + $this->executeView($view); + + $map = array( + 'comment_entity_id' => 'entity_id', + 'comment_subject' => 'subject', + 'comment_changed' => 'changed', + 'cid' => 'cid' + ); + $expected_result = array(); + foreach (array_values($this->commentsCreated) as $key => $comment) { + $expected_result[$key]['entity_id'] = $comment->entity_id->value; + $expected_result[$key]['subject'] = $comment->subject->value; + $expected_result[$key]['changed'] = $comment->changed->value; + $expected_result[$key]['cid'] = $comment->id(); + } + $this->assertIdenticalResultset($view, $expected_result, $map); + + // Check the number of results given by the display is the expected. + $this->assertEqual(count($view->result), $this->pageDisplayResults, + format_string('There are exactly @results comments. Expected @expected', + array('@results' => count($view->result), '@expected' => $this->pageDisplayResults) + ) + ); + } } diff --git a/core/modules/user/config/views.view.who_s_new.yml b/core/modules/user/config/views.view.who_s_new.yml deleted file mode 100644 index ed176533d68d..000000000000 --- a/core/modules/user/config/views.view.who_s_new.yml +++ /dev/null @@ -1,165 +0,0 @@ -base_field: uid -base_table: users -core: 8.x -description: 'Shows a list of the newest user accounts on the site.' -status: '1' -display: - block_1: - display_plugin: block - id: block_1 - display_title: 'Who''s new' - position: '1' - display_options: - display_description: 'A list of new users' - block_description: 'Who''s new' - default: - display_plugin: default - id: default - display_title: Master - position: '1' - display_options: - access: - type: perm - options: - perm: 'access content' - perm: 'access user profiles' - 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: some - options: - items_per_page: '5' - offset: '0' - style: - type: html_list - row: - type: fields - fields: - name: - id: name - table: users - field: name - 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_user: '1' - overwrite_anonymous: '0' - 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' - anonymous_text: '' - format_username: '1' - filters: - status: - value: '1' - table: users - field: status - id: status - expose: - operator: '0' - group: '1' - access: - id: access - table: users - field: access - relationship: none - group_type: group - admin_label: '' - operator: '>' - value: - min: '' - max: '' - value: '1970-01-01' - type: date - group: '1' - exposed: '0' - expose: - operator_id: '0' - label: '' - description: '' - use_operator: '0' - operator: '' - identifier: '' - required: '0' - remember: '0' - multiple: '0' - remember_roles: - authenticated: authenticated - is_grouped: '0' - group_info: - label: '' - description: '' - identifier: '' - optional: '1' - widget: select - multiple: '0' - remember: '0' - default_group: All - default_group_multiple: { } - group_items: { } - plugin_id: date - sorts: - created: - id: created - table: users - field: created - relationship: none - group_type: group - admin_label: '' - order: DESC - exposed: '0' - expose: - label: '' - granularity: second - plugin_id: date - title: 'Who''s new' - header: { } - footer: { } - empty: { } - relationships: { } - arguments: { } -label: 'Who''s new' -module: views -id: who_s_new -tag: 'default' -uuid: 8b2c05e3-046b-447f-922b-43a832220667 -langcode: en diff --git a/core/modules/user/lib/Drupal/user/Plugin/Block/UserNewBlock.php b/core/modules/user/lib/Drupal/user/Plugin/Block/UserNewBlock.php new file mode 100644 index 000000000000..30b83c8c46c8 --- /dev/null +++ b/core/modules/user/lib/Drupal/user/Plugin/Block/UserNewBlock.php @@ -0,0 +1,85 @@ +<?php + +/** + * @file + * Contains \Drupal\user\Plugin\Block\UserNewBlock. + */ + +namespace Drupal\user\Plugin\Block; + +use Drupal\block\BlockBase; +use Drupal\block\Annotation\Block; +use Drupal\Core\Annotation\Translation; +use Drupal\Core\Session\AccountInterface; + +/** + * Provides a "Who's new" block. + * + * @Block( + * id = "user_new_block", + * admin_label = @Translation("Who's new"), + * category = @Translation("Lists (Views)") + * ) + */ +class UserNewBlock extends BlockBase { + + /** + * {@inheritdoc} + */ + public function defaultConfiguration() { + return array( + 'properties' => array( + 'administrative' => TRUE + ), + 'whois_new_count' => 5 + ); + } + + /** + * {@inheritdoc} + */ + public function access(AccountInterface $account) { + return $account->hasPermission('access content'); + } + + /** + * Overrides \Drupal\block\BlockBase::blockForm(). + */ + public function blockForm($form, &$form_state) { + $form['user_block_whois_new_count'] = array( + '#type' => 'select', + '#title' => t('Number of users to display'), + '#default_value' => $this->configuration['whois_new_count'], + '#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), + ); + return $form; + } + + /** + * Overrides \Drupal\block\BlockBase::blockSubmit(). + */ + public function blockSubmit($form, &$form_state) { + $this->configuration['whois_new_count'] = $form_state['values']['user_block_whois_new_count']; + } + + /** + * {@inheritdoc} + */ + public function build() { + // Retrieve a list of new users who have accessed the site successfully. + $uids = db_query_range('SELECT uid FROM {users} WHERE status <> 0 AND access <> 0 ORDER BY created DESC', 0, $this->configuration['whois_new_count'])->fetchCol(); + $build = array( + '#theme' => 'item_list__user__new', + '#items' => array(), + ); + foreach (user_load_multiple($uids) as $account) { + $username = array( + '#theme' => 'username', + '#account' => $account, + ); + $build['#items'][] = drupal_render($username); + } + return $build; + } + +} diff --git a/core/modules/user/user.module b/core/modules/user/user.module index def67658f867..b582725d11c3 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -568,6 +568,9 @@ function user_preprocess_block(&$variables) { case 'user_login_block': $variables['attributes']['role'] = 'form'; break; + case 'user_new_block': + $variables['attributes']['role'] = 'complementary'; + break; } } } diff --git a/core/modules/views/config/views.view.comments_recent.yml b/core/modules/views/config/views.view.comments_recent.yml new file mode 100644 index 000000000000..5c50aaef80d6 --- /dev/null +++ b/core/modules/views/config/views.view.comments_recent.yml @@ -0,0 +1,466 @@ +base_field: cid +base_table: comment +core: '8' +description: 'Recent comments.' +status: false +display: + default: + id: default + display_title: Master + display_plugin: default + position: 1 + display_options: + query: + type: views_query + options: + query_comment: false + disable_sql_rewrite: false + distinct: false + slave: false + query_tags: { } + title: 'Recent comments' + use_more: '1' + access: + type: none + options: { } + cache: + type: none + options: { } + exposed_form: + type: basic + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + pager: + type: some + options: + items_per_page: 5 + offset: 0 + relationships: + node: + field: node + id: node + required: false + table: comment + plugin_id: standard + relationship: none + group_type: group + admin_label: Content + provider: views + fields: + subject: + id: subject + table: comment + field: subject + label: '' + link_to_comment: '1' + plugin_id: comment + relationship: none + group_type: group + admin_label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: '' + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + link_to_node: '0' + provider: comment + timestamp: + id: timestamp + table: comment + field: changed + label: '' + date_format: 'time ago' + plugin_id: date + relationship: none + group_type: group + admin_label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: '' + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + custom_date_format: '' + timezone: '' + provider: views + sorts: + changed: + id: changed + table: comment + field: changed + order: DESC + plugin_id: date + relationship: none + group_type: group + admin_label: '' + exposed: false + expose: + label: '' + granularity: second + provider: views + filters: + status_extra: + id: status_extra + table: node_field_data + field: status_extra + relationship: node + group: '0' + plugin_id: node_status + provider: node + style: + type: html_list + options: + grouping: { } + row_class: '' + default_row_class: true + row_class_special: true + uses_fields: false + type: ul + class: '' + wrapper_class: item-list + row: + type: fields + options: + inline: { } + separator: '' + hide_empty: false + default_field_elements: '1' + header: { } + footer: { } + empty: { } + arguments: { } + page_1: + id: page_1 + display_title: Page + display_plugin: page + position: 2 + display_options: + query: + type: views_query + options: { } + defaults: + style_plugin: '0' + style_options: '0' + row_plugin: '0' + row_options: '0' + fields: false + fields: + title: + id: title + table: node_field_data + field: title + relationship: node + label: 'Reply to' + link_to_node: '1' + plugin_id: node + group_type: group + admin_label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: '' + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + provider: node + timestamp: + id: timestamp + table: comment + field: changed + label: '' + date_format: 'time ago' + plugin_id: date + relationship: none + group_type: group + admin_label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: '' + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + custom_date_format: '' + timezone: '' + provider: views + subject: + id: subject + table: comment + field: subject + label: '' + link_to_comment: '1' + plugin_id: comment + relationship: none + group_type: group + admin_label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: '' + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + link_to_node: '0' + provider: comment + comment: + id: comment + table: comment__comment_body + field: comment_body + label: '' + plugin_id: field + relationship: none + group_type: group + admin_label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: '' + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: text_default + settings: { } + group_column: value + group_columns: { } + group_rows: '1' + delta_limit: all + delta_offset: '0' + delta_reversed: '0' + delta_first_last: '0' + multi_type: separator + separator: ', ' + field_api_classes: '0' + provider: field + path: comments/recent + style: + type: html_list + row: + type: fields + options: + inline: + title: title + timestamp: timestamp + separator: ' ' + block_1: + id: block_1 + display_title: Block + display_plugin: block + position: 3 + display_options: + query: + type: views_query + options: { } +label: 'Recent comments' +module: comment +id: comments_recent +tag: default +uuid: 67212880-6a63-453b-a902-2d13580f7d1c +langcode: en diff --git a/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php b/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php index 3f0323705cfb..cfd50e45aadc 100644 --- a/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php @@ -21,7 +21,7 @@ class DefaultViewsTest extends ViewTestBase { * * @var array */ - public static $modules = array('views', 'node', 'search', 'comment', 'taxonomy', 'block', 'user'); + public static $modules = array('views', 'node', 'search', 'comment', 'taxonomy', 'block'); /** * An array of argument arrays to use for default views. -- GitLab