diff --git a/core/modules/comment/config/schema/comment.views.schema.yml b/core/modules/comment/config/schema/comment.views.schema.yml index 0bd1332..e48b72d 100644 --- a/core/modules/comment/config/schema/comment.views.schema.yml +++ b/core/modules/comment/config/schema/comment.views.schema.yml @@ -108,9 +108,6 @@ views.filter.comment_user_uid: relationship: type: string label: 'Relationship' - links: - type: boolean - label: 'Display links' views.row.comment_rss: type: views_row @@ -119,9 +116,6 @@ views.row.comment_rss: view_mode: type: string label: 'Display type' - links: - type: boolean - label: 'Display links' views.sort.comment_ces_last_comment_name: type: views_sort diff --git a/core/modules/comment/src/Plugin/views/wizard/Comment.php b/core/modules/comment/src/Plugin/views/wizard/Comment.php index 2d3b2b5..0045666 100644 --- a/core/modules/comment/src/Plugin/views/wizard/Comment.php +++ b/core/modules/comment/src/Plugin/views/wizard/Comment.php @@ -69,70 +69,11 @@ class Comment extends WizardPluginBase { */ protected function rowStyleOptions() { $options = array(); - $options['comment'] = $this->t('comments'); + $options['entity:comment'] = $this->t('comments'); $options['fields'] = $this->t('fields'); return $options; } - protected function buildFormStyle(array &$form, FormStateInterface $form_state, $type) { - parent::buildFormStyle($form, $form_state, $type); - $style_form =& $form['displays'][$type]['options']['style']; - // Some style plugins don't support row plugins so stop here if that's the - // case. - if (!isset($style_form['row_plugin']['#default_value'])) { - return; - } - $row_plugin = $style_form['row_plugin']['#default_value']; - switch ($row_plugin) { - case 'comment': - $style_form['row_options']['links'] = array( - '#type' => 'select', - '#title' => $this->t('Should links be displayed below each comment'), - '#title_display' => 'invisible', - '#options' => array( - 1 => $this->t('with links (allow users to reply to the comment, etc.)'), - 0 => $this->t('without links'), - ), - '#default_value' => 1, - ); - break; - } - } - - /** - * {@inheritdoc} - */ - protected function pageDisplayOptions(array $form, FormStateInterface $form_state) { - $display_options = parent::pageDisplayOptions($form, $form_state); - $row_plugin = $form_state->getValue(array('page', 'style', 'row_plugin')); - $row_options = $form_state->getValue(array('page', 'style', 'row_options'), array()); - $this->display_options_row($display_options, $row_plugin, $row_options); - return $display_options; - } - - /** - * Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::blockDisplayOptions(). - */ - protected function blockDisplayOptions(array $form, FormStateInterface $form_state) { - $display_options = parent::blockDisplayOptions($form, $form_state); - $row_plugin = $form_state->getValue(array('block', 'style', 'row_plugin')); - $row_options = $form_state->getValue(array('block', 'style', 'row_options'), array()); - $this->display_options_row($display_options, $row_plugin, $row_options); - return $display_options; - } - - /** - * Set the row style and row style plugins to the display_options. - */ - protected function display_options_row(&$display_options, $row_plugin, $row_options) { - switch ($row_plugin) { - case 'comment': - $display_options['row']['type'] = 'entity:comment'; - $display_options['row']['options']['links'] = !empty($row_options['links']); - break; - } - } - /** * Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayOptions(). */ diff --git a/core/modules/node/src/Plugin/views/wizard/Node.php b/core/modules/node/src/Plugin/views/wizard/Node.php index 2ce97ca..7b646ba 100644 --- a/core/modules/node/src/Plugin/views/wizard/Node.php +++ b/core/modules/node/src/Plugin/views/wizard/Node.php @@ -83,42 +83,6 @@ protected function rowStyleOptions() { } /** - * Adds the style options to the wizard form. - * - * @param array $form - * The full wizard form array. - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The current state of the wizard form. - * @param string $type - * The display ID (e.g. 'page' or 'block'). - */ - protected function buildFormStyle(array &$form, FormStateInterface $form_state, $type) { - parent::buildFormStyle($form, $form_state, $type); - $style_form =& $form['displays'][$type]['options']['style']; - // Some style plugins don't support row plugins so stop here if that's the - // case. - if (!isset($style_form['row_plugin']['#default_value'])) { - return; - } - $row_plugin = $style_form['row_plugin']['#default_value']; - switch ($row_plugin) { - case 'full_posts': - case 'teasers': - $style_form['row_options']['links'] = array( - '#type' => 'select', - '#title' => $this->t('Should links be displayed below each node'), - '#title_display' => 'invisible', - '#options' => array( - 1 => $this->t('with links (allow users to add comments, etc.)'), - 0 => $this->t('without links'), - ), - '#default_value' => 1, - ); - break; - } - } - - /** * Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayOptions(). */ protected function defaultDisplayOptions() { @@ -210,12 +174,10 @@ protected function display_options_row(&$display_options, $row_plugin, $row_opt case 'full_posts': $display_options['row']['type'] = 'entity:node'; $display_options['row']['options']['build_mode'] = 'full'; - $display_options['row']['options']['links'] = !empty($row_options['links']); break; case 'teasers': $display_options['row']['type'] = 'entity:node'; $display_options['row']['options']['build_mode'] = 'teaser'; - $display_options['row']['options']['links'] = !empty($row_options['links']); break; case 'titles_linked': $display_options['row']['type'] = 'fields'; diff --git a/core/modules/node/src/Tests/Views/RowPluginTest.php b/core/modules/node/src/Tests/Views/RowPluginTest.php index c9dd7f1..a2f6585 100644 --- a/core/modules/node/src/Tests/Views/RowPluginTest.php +++ b/core/modules/node/src/Tests/Views/RowPluginTest.php @@ -22,7 +22,7 @@ class RowPluginTest extends NodeTestBase { * * @var array */ - public static $modules = array('node', 'comment'); + public static $modules = array('node'); /** * Views used by this test. @@ -32,13 +32,6 @@ class RowPluginTest extends NodeTestBase { public static $testViews = array('test_node_row_plugin'); /** - * Contains all comments keyed by node used by the test. - * - * @var array - */ - protected $comments; - - /** * Contains all nodes used by this test. * * @var array @@ -49,10 +42,8 @@ protected function setUp() { parent::setUp(); $this->drupalCreateContentType(array('type' => 'article')); - // Create comment field on article. - $this->container->get('comment.manager')->addDefaultField('node', 'article'); - // Create two nodes, with 5 comments on all of them. + // Create two nodes. for ($i = 0; $i < 2; $i++) { $this->nodes[] = $this->drupalCreateNode( array( @@ -67,36 +58,6 @@ protected function setUp() { ) ); } - - foreach ($this->nodes as $node) { - for ($i = 0; $i < 5; $i++) { - $this->comments[$node->id()][] = $this->drupalCreateComment(array('entity_id' => $node->id())); - } - } - } - - /** - * Helper function to create a random comment. - * - * @param array $settings - * (optional) An associative array of settings for the comment, as used in - * entity_create(). - * - * @return \Drupal\comment\Entity\Comment - * Returns the created and saved comment. - */ - public function drupalCreateComment(array $settings = array()) { - $settings += array( - 'subject' => $this->randomMachineName(), - 'entity_id' => $settings['entity_id'], - 'field_name' => 'comment', - 'entity_type' => 'node', - 'comment_body' => $this->randomMachineName(40), - ); - - $comment = entity_create('comment', $settings); - $comment->save(); - return $comment; } /** diff --git a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_field_filters.yml b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_field_filters.yml index 2eb5431..f3a6d11 100644 --- a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_field_filters.yml +++ b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_field_filters.yml @@ -55,7 +55,6 @@ display: type: 'entity:node' options: build_mode: teaser - links: false view_mode: teaser rendering_language: translation_language_renderer fields: diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml index 331c663..7cc0a6e 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml @@ -44,7 +44,6 @@ display: row_options: build_mode: teaser comments: '0' - links: '1' row_plugin: node sorts: created: @@ -82,7 +81,6 @@ display: row_options: build_mode: teaser comments: '0' - links: '1' row_plugin: fields style_options: { } style_plugin: default diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_feed.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_feed.yml index d718e15..40eb524 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_feed.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_feed.yml @@ -60,7 +60,6 @@ display: options: build_mode: teaser comments: false - links: '1' type: 'entity:node' sorts: created: diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_row_renderers.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_row_renderers.yml index 2c9cfc0..06902bd 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_row_renderers.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_row_renderers.yml @@ -34,7 +34,6 @@ display: relationship: none view_mode: teaser rendering_language: translation_language_renderer - links: 0 sorts: title: id: title diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_admin_ui.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_admin_ui.yml index 8ef634a..160fd0d 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_admin_ui.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_admin_ui.yml @@ -86,7 +86,6 @@ display: type: 'entity:node' options: comments: false - links: '1' field_langcode: '***LANGUAGE_language_content***' field_langcode_add_to_query: null display_plugin: default diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_block.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_block.yml index bf33096..0bfc37a 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_block.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_block.yml @@ -46,7 +46,6 @@ display: type: 'entity:node' options: comments: false - links: '1' field_langcode: '***LANGUAGE_language_content***' field_langcode_add_to_query: null display_plugin: default diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_form_buttons.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_form_buttons.yml index 2686abd..1ebebb2 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_form_buttons.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_form_buttons.yml @@ -46,7 +46,6 @@ display: type: 'entity:node' options: comments: false - links: '1' field_langcode: '***LANGUAGE_language_content***' field_langcode_add_to_query: null display_plugin: default diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_get_attach_displays.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_get_attach_displays.yml index b234d99..32b82da 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_get_attach_displays.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_get_attach_displays.yml @@ -37,7 +37,6 @@ display: type: 'entity:node' options: build_mode: teaser - links: '1' comments: false fields: title: diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_mini_pager.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_mini_pager.yml index 33e6bd9..b2a8117 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_mini_pager.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_mini_pager.yml @@ -51,7 +51,6 @@ display: type: 'entity:node' options: build_mode: teaser - links: '1' comments: false fields: title: diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_redirect_view.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_redirect_view.yml index d77afef..cba7242 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_redirect_view.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_redirect_view.yml @@ -37,7 +37,6 @@ display: type: 'entity:node' options: build_mode: teaser - links: '1' comments: false fields: title: