summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries2014-09-05 16:29:12 (GMT)
committerDries2014-09-05 16:31:15 (GMT)
commit05212a97276d0c61da5fb818db136a04f63eb746 (patch)
treed1b8d8d587a617967b068a8972ca41e068119495
parent0ede95dd0b2f2b54e51152e096d29d0f3e564dfd (diff)
Issue #2271349 by Berdir, Arla, blueminds, larowlan, Dave Reid: Node and Comment ops links should be display components (which can be disabled).
-rw-r--r--core/modules/comment/comment.module6
-rw-r--r--core/modules/comment/src/CommentViewBuilder.php38
-rw-r--r--core/modules/comment/src/Plugin/views/row/CommentRow.php56
-rw-r--r--core/modules/comment/src/Plugin/views/row/Rss.php14
-rw-r--r--core/modules/comment/src/Tests/CommentLinksTest.php33
-rw-r--r--core/modules/comment/templates/comment.html.twig4
-rw-r--r--core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_row.yml1
-rw-r--r--core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_field_filters.yml3
-rw-r--r--core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php14
-rw-r--r--core/modules/node/config/install/views.view.archive.yml1
-rw-r--r--core/modules/node/config/install/views.view.frontpage.yml2
-rw-r--r--core/modules/node/config/schema/node.views.schema.yml6
-rw-r--r--core/modules/node/node.module6
-rw-r--r--core/modules/node/src/NodeViewBuilder.php33
-rw-r--r--core/modules/node/src/Plugin/views/row/NodeRow.php16
-rw-r--r--core/modules/node/src/Plugin/views/row/Rss.php14
-rw-r--r--core/modules/node/src/Tests/NodeLinksTest.php47
-rw-r--r--core/modules/node/src/Tests/Views/NodeFieldFilterTest.php3
-rw-r--r--core/modules/node/src/Tests/Views/RowPluginTest.php21
-rw-r--r--core/modules/node/tests/modules/node_test_views/test_views/views.view.test_contextual_links.yml1
-rw-r--r--core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_row_plugin.yml1
-rw-r--r--core/modules/taxonomy/config/install/views.view.taxonomy_term.yml2
-rw-r--r--core/modules/views/views.module5
-rw-r--r--core/themes/bartik/templates/comment.html.twig8
24 files changed, 134 insertions, 201 deletions
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index 46a41f5..5f6f906 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -111,6 +111,12 @@ function comment_entity_extra_field_info() {
),
),
);
+ $return['comment'][$comment_type->id()]['display']['links'] = array(
+ 'label' => t('Links'),
+ 'description' => t('Comment operation links'),
+ 'weight' => 100,
+ 'visible' => TRUE,
+ );
}
return $return;
diff --git a/core/modules/comment/src/CommentViewBuilder.php b/core/modules/comment/src/CommentViewBuilder.php
index fc8da5e..d2d6290 100644
--- a/core/modules/comment/src/CommentViewBuilder.php
+++ b/core/modules/comment/src/CommentViewBuilder.php
@@ -111,24 +111,28 @@ class CommentViewBuilder extends EntityViewBuilder {
}
$build[$id]['#entity'] = $entity;
$build[$id]['#theme'] = 'comment__' . $entity->getFieldName() . '__' . $commented_entity->bundle();
- $callback = '\Drupal\comment\CommentViewBuilder::renderLinks';
- $context = array(
- 'comment_entity_id' => $entity->id(),
- 'view_mode' => $view_mode,
- 'langcode' => $langcode,
- 'commented_entity_type' => $commented_entity->getEntityTypeId(),
- 'commented_entity_id' => $commented_entity->id(),
- 'in_preview' => !empty($entity->in_preview),
- );
- $placeholder = drupal_render_cache_generate_placeholder($callback, $context);
- $build[$id]['links'] = array(
- '#post_render_cache' => array(
- $callback => array(
- $context,
+
+ $display = $displays[$entity->bundle()];
+ if ($display->getComponent('links')) {
+ $callback = '\Drupal\comment\CommentViewBuilder::renderLinks';
+ $context = array(
+ 'comment_entity_id' => $entity->id(),
+ 'view_mode' => $view_mode,
+ 'langcode' => $langcode,
+ 'commented_entity_type' => $commented_entity->getEntityTypeId(),
+ 'commented_entity_id' => $commented_entity->id(),
+ 'in_preview' => !empty($entity->in_preview),
+ );
+ $placeholder = drupal_render_cache_generate_placeholder($callback, $context);
+ $build[$id]['links'] = array(
+ '#post_render_cache' => array(
+ $callback => array(
+ $context,
+ ),
),
- ),
- '#markup' => $placeholder,
- );
+ '#markup' => $placeholder,
+ );
+ }
$account = comment_prepare_author($entity);
if (\Drupal::config('user.settings')->get('signatures') && $account->getSignature()) {
diff --git a/core/modules/comment/src/Plugin/views/row/CommentRow.php b/core/modules/comment/src/Plugin/views/row/CommentRow.php
deleted file mode 100644
index 5256b56..0000000
--- a/core/modules/comment/src/Plugin/views/row/CommentRow.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\comment\Plugin\views\row\CommentRow.
- */
-
-namespace Drupal\comment\Plugin\views\row;
-
-use Drupal\Core\Form\FormStateInterface;
-use Drupal\views\Plugin\views\row\EntityRow;
-
-/**
- * Plugin which performs a comment_view on the resulting object.
- *
- * @ViewsRow(
- * id = "entity:comment",
- * )
- */
-class CommentRow extends EntityRow {
-
- /**
- * {@inheritdoc}
- */
- protected function defineOptions() {
- $options = parent::defineOptions();
- $options['links'] = array('default' => TRUE);
- $options['view_mode']['default'] = 'full';
- return $options;
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildOptionsForm(&$form, FormStateInterface $form_state) {
- parent::buildOptionsForm($form, $form_state);
-
- $form['links'] = array(
- '#type' => 'checkbox',
- '#title' => t('Display links'),
- '#default_value' => $this->options['links'],
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function render($row) {
- $build = parent::render($row);
- if (!$this->options['links']) {
- unset($build['links']);
- }
- return $build;
- }
-
-}
diff --git a/core/modules/comment/src/Plugin/views/row/Rss.php b/core/modules/comment/src/Plugin/views/row/Rss.php
index d24eefe..50354fb 100644
--- a/core/modules/comment/src/Plugin/views/row/Rss.php
+++ b/core/modules/comment/src/Plugin/views/row/Rss.php
@@ -32,7 +32,6 @@ class Rss extends RowPluginBase {
$options = parent::defineOptions();
$options['view_mode'] = array('default' => 'default');
- $options['links'] = array('default' => FALSE, 'bool' => TRUE);
return $options;
}
@@ -46,11 +45,6 @@ class Rss extends RowPluginBase {
'#options' => $this->options_form_summary_options(),
'#default_value' => $this->options['view_mode'],
);
- $form['links'] = array(
- '#type' => 'checkbox',
- '#title' => t('Display links'),
- '#default_value' => $this->options['links'],
- );
}
public function preRender($result) {
@@ -134,14 +128,8 @@ class Rss extends RowPluginBase {
$this->view->style_plugin->namespaces = array_merge($this->view->style_plugin->namespaces, $comment->rss_namespaces);
}
- // Hide the links if desired.
- if (!$this->options['links']) {
- hide($build['links']);
- }
-
if ($view_mode != 'title') {
- // We render comment contents and force links to be last.
- $build['links']['#weight'] = 1000;
+ // We render comment contents.
$item_text .= drupal_render($build);
}
diff --git a/core/modules/comment/src/Tests/CommentLinksTest.php b/core/modules/comment/src/Tests/CommentLinksTest.php
index bc4f60d..00484b6 100644
--- a/core/modules/comment/src/Tests/CommentLinksTest.php
+++ b/core/modules/comment/src/Tests/CommentLinksTest.php
@@ -10,6 +10,7 @@ namespace Drupal\comment\Tests;
use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\comment\CommentInterface;
+use Drupal\entity\Entity\EntityViewDisplay;
/**
* Basic comment links tests to ensure markup present.
@@ -42,16 +43,7 @@ class CommentLinksTest extends CommentTestBase {
public static $modules = array('views');
/**
- * Tests comment links.
- *
- * The output of comment links depends on various environment conditions:
- * - Various Comment module configuration settings, user registration
- * settings, and user access permissions.
- * - Whether the user is authenticated or not, and whether any comments exist.
- *
- * To account for all possible cases, this test creates permutations of all
- * possible conditions and tests the expected appearance of comment links in
- * each environment.
+ * Tests that comment links are output and can be hidden.
*/
public function testCommentLinks() {
// Bartik theme alters comment links, so use a different theme.
@@ -112,6 +104,27 @@ class CommentLinksTest extends CommentTestBase {
}
$this->assertLink('Add new comment');
}
+
+ // Make sure we can hide node links.
+ entity_get_display('node', $this->node->bundle(), 'default')
+ ->removeComponent('links')
+ ->save();
+ $this->drupalGet($this->node->url());
+ $this->assertNoLink('1 comment');
+ $this->assertNoLink('Add new comment');
+
+ // Visit the full node, make sure there are links for the comment.
+ $this->drupalGet('node/' . $this->node->id());
+ $this->assertText($comment->getSubject());
+ $this->assertLink('Reply');
+
+ // Make sure we can hide comment links.
+ entity_get_display('comment', 'comment', 'default')
+ ->removeComponent('links')
+ ->save();
+ $this->drupalGet('node/' . $this->node->id());
+ $this->assertText($comment->getSubject());
+ $this->assertNoLink('Reply');
}
}
diff --git a/core/modules/comment/templates/comment.html.twig b/core/modules/comment/templates/comment.html.twig
index 7ffb7c0..575510f 100644
--- a/core/modules/comment/templates/comment.html.twig
+++ b/core/modules/comment/templates/comment.html.twig
@@ -107,5 +107,7 @@
</div>
{% endif %}
</div>
- {{ content.links }}
+ {% if content.links %}
+ {{ content.links }}
+ {% endif %}
</article>
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 c8e2964..ad1e74e 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
@@ -68,7 +68,6 @@ display:
row:
type: 'entity:comment'
options:
- links: true
view_mode: full
relationships:
node:
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 aa73012..a743eea 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
@@ -63,8 +63,7 @@ display:
row:
type: 'entity:comment'
options:
- links: true
- view_mode: full
+ view_mode: default
rendering_language: translation_language_renderer
relationships:
node:
diff --git a/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php b/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
index e52e0ed..f975b57 100644
--- a/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
+++ b/core/modules/entity_reference/src/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
@@ -48,12 +48,6 @@ class EntityReferenceEntityFormatter extends EntityReferenceFormatterBase {
'#required' => TRUE,
);
- $elements['links'] = array(
- '#type' => 'checkbox',
- '#title' => t('Show links'),
- '#default_value' => $this->getSetting('links'),
- );
-
return $elements;
}
@@ -66,7 +60,6 @@ class EntityReferenceEntityFormatter extends EntityReferenceFormatterBase {
$view_modes = \Drupal::entityManager()->getViewModeOptions($this->getFieldSetting('target_type'));
$view_mode = $this->getSetting('view_mode');
$summary[] = t('Rendered as @mode', array('@mode' => isset($view_modes[$view_mode]) ? $view_modes[$view_mode] : $view_mode));
- $summary[] = $this->getSetting('links') ? t('Display links') : t('Do not display links');
return $summary;
}
@@ -76,9 +69,6 @@ class EntityReferenceEntityFormatter extends EntityReferenceFormatterBase {
*/
public function viewElements(FieldItemListInterface $items) {
$view_mode = $this->getSetting('view_mode');
- $links = $this->getSetting('links');
-
- $target_type = $this->getFieldSetting('target_type');
$elements = array();
@@ -97,10 +87,6 @@ class EntityReferenceEntityFormatter extends EntityReferenceFormatterBase {
if (!empty($item->target_id)) {
$elements[$delta] = entity_view($item->entity, $view_mode, $item->getLangcode());
- if (empty($links) && isset($result[$delta][$target_type][$item->target_id]['links'])) {
- // Hide the element links.
- $elements[$delta][$target_type][$item->target_id]['links']['#access'] = FALSE;
- }
// Add a resource attribute to set the mapping property's value to the
// entity's url. Since we don't know what the markup of the entity will
// be, we shouldn't rely on it for structured data such as RDFa.
diff --git a/core/modules/node/config/install/views.view.archive.yml b/core/modules/node/config/install/views.view.archive.yml
index f8dd979..450868f 100644
--- a/core/modules/node/config/install/views.view.archive.yml
+++ b/core/modules/node/config/install/views.view.archive.yml
@@ -116,7 +116,6 @@ display:
type: 'entity:node'
options:
view_mode: teaser
- links: true
comments: false
provider: node
header: { }
diff --git a/core/modules/node/config/install/views.view.frontpage.yml b/core/modules/node/config/install/views.view.frontpage.yml
index 3a3dbcb..f178b96 100644
--- a/core/modules/node/config/install/views.view.frontpage.yml
+++ b/core/modules/node/config/install/views.view.frontpage.yml
@@ -196,7 +196,6 @@ display:
options:
build_mode: teaser
comments: false
- links: true
view_mode: teaser
provider: views
sorts:
@@ -284,7 +283,6 @@ display:
options:
relationship: none
view_mode: rss
- links: false
provider: views
field_langcode: '***LANGUAGE_language_content***'
field_langcode_add_to_query: null
diff --git a/core/modules/node/config/schema/node.views.schema.yml b/core/modules/node/config/schema/node.views.schema.yml
index bc95945..a672177 100644
--- a/core/modules/node/config/schema/node.views.schema.yml
+++ b/core/modules/node/config/schema/node.views.schema.yml
@@ -4,9 +4,6 @@
type: views_entity_row
label: 'Entity options'
mapping:
- links:
- type: boolean
- label: 'Display links'
comments:
type: boolean
label: 'Show comments'
@@ -253,6 +250,3 @@ views.row.node_rss:
view_mode:
type: string
label: 'Display type'
- links:
- type: boolean
- label: 'Display links'
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index d96052d..d8882cc 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -432,6 +432,12 @@ function node_entity_extra_field_info() {
'weight' => 0,
'visible' => FALSE,
);
+ $extra['node'][$bundle->type]['display']['links'] = array(
+ 'label' => t('Links'),
+ 'description' => $description,
+ 'weight' => 100,
+ 'visible' => TRUE,
+ );
}
return $extra;
diff --git a/core/modules/node/src/NodeViewBuilder.php b/core/modules/node/src/NodeViewBuilder.php
index 606ef36..74c79c7 100644
--- a/core/modules/node/src/NodeViewBuilder.php
+++ b/core/modules/node/src/NodeViewBuilder.php
@@ -34,23 +34,24 @@ class NodeViewBuilder extends EntityViewBuilder {
$bundle = $entity->bundle();
$display = $displays[$bundle];
- $callback = '\Drupal\node\NodeViewBuilder::renderLinks';
- $context = array(
- 'node_entity_id' => $entity->id(),
- 'view_mode' => $view_mode,
- 'langcode' => $langcode,
- 'in_preview' => !empty($entity->in_preview),
- );
- $placeholder = drupal_render_cache_generate_placeholder($callback, $context);
- $build[$id]['links'] = array(
- '#post_render_cache' => array(
- $callback => array(
- $context,
+ if ($display->getComponent('links')) {
+ $callback = '\Drupal\node\NodeViewBuilder::renderLinks';
+ $context = array(
+ 'node_entity_id' => $entity->id(),
+ 'view_mode' => $view_mode,
+ 'langcode' => $langcode,
+ 'in_preview' => !empty($entity->in_preview),
+ );
+ $placeholder = drupal_render_cache_generate_placeholder($callback, $context);
+ $build[$id]['links'] = array(
+ '#post_render_cache' => array(
+ $callback => array(
+ $context,
+ ),
),
- ),
- '#markup' => $placeholder,
- );
-
+ '#markup' => $placeholder,
+ );
+ }
// Add Language field text element to node render array.
if ($display->getComponent('langcode')) {
diff --git a/core/modules/node/src/Plugin/views/row/NodeRow.php b/core/modules/node/src/Plugin/views/row/NodeRow.php
index c79691f..c8cd7c0 100644
--- a/core/modules/node/src/Plugin/views/row/NodeRow.php
+++ b/core/modules/node/src/Plugin/views/row/NodeRow.php
@@ -7,7 +7,6 @@
namespace Drupal\node\Plugin\views\row;
-use Drupal\Core\Form\FormStateInterface;
use Drupal\views\Plugin\views\row\EntityRow;
/**
@@ -31,22 +30,7 @@ class NodeRow extends EntityRow {
$options['view_mode']['default'] = 'teaser';
- $options['links'] = array('default' => TRUE, 'bool' => TRUE);
-
return $options;
}
- /**
- * {@inheritdoc}
- */
- public function buildOptionsForm(&$form, FormStateInterface $form_state) {
- parent::buildOptionsForm($form, $form_state);
-
- $form['links'] = array(
- '#type' => 'checkbox',
- '#title' => t('Display links'),
- '#default_value' => $this->options['links'],
- );
- }
-
}
diff --git a/core/modules/node/src/Plugin/views/row/Rss.php b/core/modules/node/src/Plugin/views/row/Rss.php
index 9d3db7b..820f9fb 100644
--- a/core/modules/node/src/Plugin/views/row/Rss.php
+++ b/core/modules/node/src/Plugin/views/row/Rss.php
@@ -40,7 +40,6 @@ class Rss extends RowPluginBase {
$options = parent::defineOptions();
$options['view_mode'] = array('default' => 'default');
- $options['links'] = array('default' => FALSE, 'bool' => TRUE);
return $options;
}
@@ -54,11 +53,6 @@ class Rss extends RowPluginBase {
'#options' => $this->buildOptionsForm_summary_options(),
'#default_value' => $this->options['view_mode'],
);
- $form['links'] = array(
- '#type' => 'checkbox',
- '#title' => t('Display links'),
- '#default_value' => $this->options['links'],
- );
}
/**
@@ -152,14 +146,8 @@ class Rss extends RowPluginBase {
$this->view->style_plugin->namespaces += $xml_rdf_namespaces;
}
- // Hide the links if desired.
- if (!$this->options['links']) {
- hide($build['links']);
- }
-
if ($display_mode != 'title') {
- // We render node contents and force links to be last.
- $build['links']['#weight'] = 1000;
+ // We render node contents.
$item_text .= drupal_render($build);
}
diff --git a/core/modules/node/src/Tests/NodeLinksTest.php b/core/modules/node/src/Tests/NodeLinksTest.php
new file mode 100644
index 0000000..4c0efa7
--- /dev/null
+++ b/core/modules/node/src/Tests/NodeLinksTest.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * @file
+ * Contains \Drupal\node\Tests\NodeLinksTest
+ */
+
+namespace Drupal\node\Tests;
+
+/**
+ * Tests the output of node links (read more, add new comment, etc).
+ *
+ * @group node
+ */
+class NodeLinksTest extends NodeTestBase {
+
+ /**
+ * Modules to enable.
+ *
+ * @var array
+ */
+ public static $modules = array('views');
+
+ /**
+ * Tests that the links can be hidden in the view display settings.
+ */
+ public function testHideLinks() {
+ $node = $this->drupalCreateNode(array(
+ 'type' => 'article',
+ 'promote' => NODE_PROMOTED,
+ ));
+
+ // Links are displayed by default.
+ $this->drupalGet('node');
+ $this->assertText($node->getTitle());
+ $this->assertLink('Read more');
+
+ // Hide links.
+ entity_get_display('node', 'article', 'teaser')
+ ->removeComponent('links')
+ ->save();
+
+ $this->drupalGet('node');
+ $this->assertText($node->getTitle());
+ $this->assertNoLink('Read more');
+ }
+
+}
diff --git a/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php b/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php
index d7ffc03..9460c7b 100644
--- a/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php
+++ b/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php
@@ -112,6 +112,9 @@ class NodeFieldFilterTest extends NodeTestBase {
* Message suffix to display.
*/
protected function assertPageCounts($path, $counts, $message) {
+ // Disable read more links.
+ entity_get_display('node', 'page', 'teaser')->removeComponent('links')->save();
+
// Get the text of the page.
$this->drupalGet($path);
$text = $this->getTextContent();
diff --git a/core/modules/node/src/Tests/Views/RowPluginTest.php b/core/modules/node/src/Tests/Views/RowPluginTest.php
index 4813bd6..c9dd7f1 100644
--- a/core/modules/node/src/Tests/Views/RowPluginTest.php
+++ b/core/modules/node/src/Tests/Views/RowPluginTest.php
@@ -125,27 +125,6 @@ class RowPluginTest extends NodeTestBase {
$this->assertTrue(strpos($output, $node->body->summary) !== FALSE, 'Make sure the teaser appears in the output of the view.');
$this->assertFalse(strpos($output, $node->body->value) !== FALSE, 'Make sure the full text does not appears in the output of the view if teaser is set as viewmode.');
}
-
- // Test with links disabled.
- $view->rowPlugin->options['links'] = FALSE;
- \Drupal::entityManager()->getViewBuilder('node')->resetCache();
- $output = $view->preview();
- $output = drupal_render($output);
- $this->drupalSetContent($output);
- foreach ($this->nodes as $node) {
- $this->assertFalse($this->xpath('//li[contains(@class, :class)]/a[contains(@href, :href)]', array(':class' => 'node-readmore', ':href' => "node/{$node->id()}")), 'Make sure no readmore link appears.');
- }
-
- // Test with links enabled.
- $view->rowPlugin->options['links'] = TRUE;
- \Drupal::entityManager()->getViewBuilder('node')->resetCache();
- $output = $view->preview();
- $output = drupal_render($output);
- $this->drupalSetContent($output);
- foreach ($this->nodes as $node) {
- $this->assertTrue($this->xpath('//li[contains(@class, :class)]/a[contains(@href, :href)]', array(':class' => 'node-readmore', ':href' => "node/{$node->id()}")), 'Make sure no readmore link appears.');
- }
-
}
}
diff --git a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_contextual_links.yml b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_contextual_links.yml
index 8aaab2c..1850ce6 100644
--- a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_contextual_links.yml
+++ b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_contextual_links.yml
@@ -47,7 +47,6 @@ display:
options:
build_mode: teaser
comments: false
- links: true
view_mode: teaser
style:
type: default
diff --git a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_row_plugin.yml b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_row_plugin.yml
index 4efc395..036b80b 100644
--- a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_row_plugin.yml
+++ b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_row_plugin.yml
@@ -33,7 +33,6 @@ display:
options:
build_mode: teaser
comments: false
- links: true
type: 'entity:node'
sorts: { }
style:
diff --git a/core/modules/taxonomy/config/install/views.view.taxonomy_term.yml b/core/modules/taxonomy/config/install/views.view.taxonomy_term.yml
index b008800..db374a8 100644
--- a/core/modules/taxonomy/config/install/views.view.taxonomy_term.yml
+++ b/core/modules/taxonomy/config/install/views.view.taxonomy_term.yml
@@ -171,7 +171,6 @@ display:
type: 'entity:node'
options:
view_mode: teaser
- links: true
comments: false
provider: views
header: { }
@@ -238,7 +237,6 @@ display:
options:
relationship: none
view_mode: default
- links: false
provider: views
label: 'Taxonomy term'
module: taxonomy
diff --git a/core/modules/views/views.module b/core/modules/views/views.module
index 5a30bf0..b4da2d9 100644
--- a/core/modules/views/views.module
+++ b/core/modules/views/views.module
@@ -246,11 +246,6 @@ function views_preprocess_node(&$variables) {
$variables['page'] = FALSE;
}
}
-
- // Allow to alter comments and links based on the settings in the row plugin.
- if (!empty($variables['view']->rowPlugin) && $variables['view']->rowPlugin->getPluginId() == 'entity:node') {
- node_row_node_view_preprocess_node($variables);
- }
}
/**
diff --git a/core/themes/bartik/templates/comment.html.twig b/core/themes/bartik/templates/comment.html.twig
index c00a9c5..7a22fc0 100644
--- a/core/themes/bartik/templates/comment.html.twig
+++ b/core/themes/bartik/templates/comment.html.twig
@@ -119,9 +119,11 @@
</div>
{% endif %}
- <nav>
- {{ content.links }}
- </nav>
+ {% if content.links %}
+ <nav>
+ {{ content.links }}
+ </nav>
+ {% endif %}
</footer> <!-- /.comment-footer -->
</div> <!-- /.comment-text -->