diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index bb203bf..b9d84e4 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -661,11 +661,17 @@ function template_preprocess_comment(&$variables) { else { $uri = $comment->permalink(); $attributes = $uri->getOption('attributes') ?: []; - $attributes += ['class' => ['permalink'], 'rel' => 'bookmark']; + $attributes += ['class' => ['permalink']]; + if (CommentType::load($comment->bundle())->getNofollow()) { + $attributes += ['rel' => 'bookmark nofollow']; + } + else { + $attributes += ['rel' => 'bookmark']; + } $uri->setOption('attributes', $attributes); $variables['title'] = \Drupal::l($comment->getSubject(), $uri); - $variables['permalink'] = \Drupal::l(t('Permalink'), $comment->permalink()); + $variables['permalink'] = \Drupal::l(t('Permalink'), $uri); } $variables['submitted'] = t('Submitted by @username on @datetime', ['@username' => $variables['author'], '@datetime' => $variables['created']]); @@ -690,7 +696,13 @@ function template_preprocess_comment(&$variables) { } $permalink_uri_parent = $comment_parent->permalink(); $attributes = $permalink_uri_parent->getOption('attributes') ?: []; - $attributes += ['class' => ['permalink'], 'rel' => 'bookmark']; + $attributes += ['class' => ['permalink']]; + if (CommentType::load($comment_parent->bundle())->getNofollow()) { + $attributes += ['rel' => 'bookmark nofollow']; + } + else { + $attributes += ['rel' => 'bookmark']; + } $permalink_uri_parent->setOption('attributes', $attributes); $variables['parent_title'] = \Drupal::l($comment_parent->getSubject(), $permalink_uri_parent); $variables['parent_permalink'] = \Drupal::l(t('Parent permalink'), $permalink_uri_parent); diff --git a/core/modules/comment/config/schema/comment.schema.yml b/core/modules/comment/config/schema/comment.schema.yml index 0f64318..9b927e6 100644 --- a/core/modules/comment/config/schema/comment.schema.yml +++ b/core/modules/comment/config/schema/comment.schema.yml @@ -66,6 +66,9 @@ comment.type.*: description: type: text label: 'Description' + nofollow: + type: boolean + label: 'Rel nofollow' field.storage_settings.comment: type: mapping diff --git a/core/modules/comment/src/CommentTypeForm.php b/core/modules/comment/src/CommentTypeForm.php index 0ac5b44..64033b7 100644 --- a/core/modules/comment/src/CommentTypeForm.php +++ b/core/modules/comment/src/CommentTypeForm.php @@ -122,6 +122,13 @@ public function form(array $form, FormStateInterface $form_state) { ]; } + $form['nofollow'] = [ + '#type' => 'checkbox', + '#title' => t('Nofollow'), + '#default_value' => $comment_type->getNofollow(), + '#description' => t('Add nofollow to rel attribute of comment type.'), + ]; + if ($this->moduleHandler->moduleExists('content_translation')) { $form['language'] = [ '#type' => 'details', diff --git a/core/modules/comment/src/CommentTypeInterface.php b/core/modules/comment/src/CommentTypeInterface.php index acde96c..a82bab3 100644 --- a/core/modules/comment/src/CommentTypeInterface.php +++ b/core/modules/comment/src/CommentTypeInterface.php @@ -35,4 +35,12 @@ public function setDescription($description); */ public function getTargetEntityTypeId(); + /** + * Gets the setting of rel's nofollow for this comment type. + * + * @return bool + * TRUE if the comment type has the rel set to nofollow, FALSE otherwise. + */ + public function getNofollow(); + } diff --git a/core/modules/comment/src/Entity/CommentType.php b/core/modules/comment/src/Entity/CommentType.php index a773c58..62009db 100644 --- a/core/modules/comment/src/Entity/CommentType.php +++ b/core/modules/comment/src/Entity/CommentType.php @@ -44,6 +44,7 @@ * "label", * "target_entity_type_id", * "description", + * "nofollow", * } * ) */ @@ -78,6 +79,13 @@ class CommentType extends ConfigEntityBundleBase implements CommentTypeInterface protected $target_entity_type_id; /** + * Whether the comment type has rel set to nofollow. + * + * @var bool + */ + protected $nofollow = TRUE; + + /** * {@inheritdoc} */ public function getDescription() { @@ -99,4 +107,11 @@ public function getTargetEntityTypeId() { return $this->target_entity_type_id; } + /** + * {@inheritdoc} + */ + public function getNofollow() { + return $this->nofollow; + } + } diff --git a/core/modules/comment/src/Tests/CommentTestBase.php b/core/modules/comment/src/Tests/CommentTestBase.php index 3b923ff..7210065 100644 --- a/core/modules/comment/src/Tests/CommentTestBase.php +++ b/core/modules/comment/src/Tests/CommentTestBase.php @@ -401,6 +401,7 @@ protected function createCommentType($label) { 'label' => $label, 'description' => '', 'target_entity_type_id' => 'node', + 'nofollow' => TRUE, ]); $bundle->save(); return $bundle; diff --git a/core/modules/comment/src/Tests/CommentTestTrait.php b/core/modules/comment/src/Tests/CommentTestTrait.php index 038a3df..739aace 100644 --- a/core/modules/comment/src/Tests/CommentTestTrait.php +++ b/core/modules/comment/src/Tests/CommentTestTrait.php @@ -47,6 +47,7 @@ public function addDefaultCommentField($entity_type, $bundle, $field_name = 'com 'id' => $comment_type_id, 'label' => Unicode::ucfirst($comment_type_id), 'target_entity_type_id' => $entity_type, + 'nofollow' => TRUE, 'description' => 'Default comment field', ])->save(); } diff --git a/core/modules/comment/tests/src/Functional/CommentFieldsTest.php b/core/modules/comment/tests/src/Functional/CommentFieldsTest.php index 2df9973..dc5aa2f 100644 --- a/core/modules/comment/tests/src/Functional/CommentFieldsTest.php +++ b/core/modules/comment/tests/src/Functional/CommentFieldsTest.php @@ -168,6 +168,7 @@ public function testCommentFieldCreate() { 'label' => 'user_comment_type', 'description' => '', 'target_entity_type_id' => 'user', + 'nofollow' => TRUE, ]); $bundle->save(); diff --git a/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php b/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php index 7342633..e3293dd 100644 --- a/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php +++ b/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php @@ -80,10 +80,11 @@ public function testCommentInterface() { $this->assertText($comment_text, 'Individual comment body found.'); $arguments = [ ':link' => base_path() . 'comment/' . $comment->id() . '#comment-' . $comment->id(), + ':rel' => 'nofollow', ]; - $pattern_permalink = '//footer[contains(@class,"comment__meta")]/a[contains(@href,:link) and text()="Permalink"]'; + $pattern_permalink = '//footer[contains(@class,"comment__meta")]/a[contains(@href,:link) and contains(@rel,:rel) and text()="Permalink"]'; $permalink = $this->xpath($pattern_permalink, $arguments); - $this->assertTrue(!empty($permalink), 'Permalink link found.'); + $this->assertTrue(!empty($permalink), 'Permalink link found and rel is set to nofollow.'); // Set comments to have subject and preview to optional. $this->drupalLogout(); diff --git a/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php index 5889d69..19dc593 100644 --- a/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php +++ b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php @@ -56,6 +56,7 @@ protected function setUp() { 'label' => 'Comment settings', 'description' => 'Comment settings', 'target_entity_type_id' => 'entity_test', + 'nofollow' => TRUE, ])->save(); // Create comment field on entity_test bundle. $this->addDefaultCommentField('entity_test', 'entity_test'); @@ -411,6 +412,7 @@ public function testCommentFunctionality() { 'label' => 'Foobar', 'description' => '', 'target_entity_type_id' => 'entity_test', + 'nofollow' => TRUE, ]); $bundle->save(); diff --git a/core/modules/comment/tests/src/Functional/CommentTestBase.php b/core/modules/comment/tests/src/Functional/CommentTestBase.php index 7cadcbf..e00126c 100644 --- a/core/modules/comment/tests/src/Functional/CommentTestBase.php +++ b/core/modules/comment/tests/src/Functional/CommentTestBase.php @@ -395,6 +395,7 @@ protected function createCommentType($label) { 'label' => $label, 'description' => '', 'target_entity_type_id' => 'node', + 'nofollow' => TRUE, ]); $bundle->save(); return $bundle; diff --git a/core/modules/comment/tests/src/Functional/CommentTitleTest.php b/core/modules/comment/tests/src/Functional/CommentTitleTest.php index 65c4937..b6b5967 100644 --- a/core/modules/comment/tests/src/Functional/CommentTitleTest.php +++ b/core/modules/comment/tests/src/Functional/CommentTitleTest.php @@ -77,6 +77,11 @@ public function testCommentPopulatedTitles() { // Tests that the comment's title link contains the url fragment. $this->assertTrue(strpos($comment_permalink, '#comment-' . $comment1->id()), "The comment's title link contains the url fragment."); $this->assertEqual($comment1->permalink()->toString(), $comment_permalink, "The comment's title has the correct link."); + + $comment_permalink_rel = $this->cssSelect('.permalink'); + $comment_permalink_rel = $comment_permalink_rel[0]->getAttribute('rel'); + // Tests that the comment's title link contains the nofollow rel. + $this->assertTrue(strpos($comment_permalink_rel, 'nofollow'), "The comment's title link contains the nofollow rel."); } } diff --git a/core/modules/comment/tests/src/Functional/CommentTypeNofollowTest.php b/core/modules/comment/tests/src/Functional/CommentTypeNofollowTest.php new file mode 100644 index 0000000..128de0d --- /dev/null +++ b/core/modules/comment/tests/src/Functional/CommentTypeNofollowTest.php @@ -0,0 +1,153 @@ +adminUser = $this->drupalCreateUser($this->permissions); + + $this->commentType = $this->createCommentType('other'); + + } + + /** + * Tests editing a comment type defined nofollow. + */ + public function testCommentTypeEditNofollow() { + // Log in a test user. + $this->drupalLogin($this->adminUser); + + $this->drupalGet('admin/structure/comment/manage/' . $this->commentType->id()); + $this->assertResponse(200, 'The comment type can be accessed at the edit form.'); + + // Edit the nofollow setting via the user interface. + $edit = [ + 'nofollow' => FALSE, + ]; + $this->drupalPostForm('admin/structure/comment/manage/' . $this->commentType->id(), $edit, t('Save')); + \Drupal::entityManager()->getStorage('comment_type')->resetCache(['other']); + $comment_type = CommentType::load('other'); + $this->assertEqual($comment_type->getNofollow(), FALSE); + } + + public function testCommentViewCommentTypeNofollow() { + // Log in a test user. + $this->drupalLogin($this->adminUser); + + $this->drupalCreateContentType(['type' => 'test_node']); + $this->addDefaultCommentField('node', 'test_node', 'comment_other', CommentItemInterface::OPEN, 'other'); + + $this->drupalGet('admin/structure/comment/manage/' . $this->commentType->id()); + $this->assertResponse(200, 'The comment type can be accessed at the edit form.'); + + // Change the nofollow to FALSE. + $edit = [ + 'nofollow' => FALSE, + ]; + $this->drupalPostForm('admin/structure/comment/manage/' . $this->commentType->id(), $edit, t('Save')); + \Drupal::entityManager()->getStorage('comment_type')->resetCache(['other']); + $this->commentType = CommentType::load('other'); + + $testNode = $this->drupalCreateNode(['type' => 'test_node']); + + // Create a comment. + $comment = Comment::create([ + 'subject' => $this->randomMachineName(8), + 'comment_body' => $this->randomMachineName(8), + 'entity_id' => $testNode->id(), + 'entity_type' => 'node', + 'field_name' => 'comment_other', + 'status' => CommentInterface::PUBLISHED, + ]); + $comment->save(); + + // Check the nofollow on the comment page. + $this->drupalGet('comment/' . $comment->id()); + $arguments = [ + ':rel' => 'nofollow', + ]; + $pattern_permalink = '//footer[contains(@class,"comment__meta")]/a[contains(@rel,:rel) and text()="Permalink"]'; + $permalink = $this->xpath($pattern_permalink, $arguments); + $this->assertFalse(!empty($permalink), 'Permalink link found and rel is not set to nofollow.'); + + // Check the nofollow on the reply page. + $this->drupalGet('comment/reply/node/' . $testNode->id() . '/comment_other/' . $comment->id()); + $arguments = [ + ':rel' => 'nofollow', + ]; + $pattern_permalink = '//footer[contains(@class,"comment__meta")]/a[contains(@rel,:rel) and text()="Permalink"]'; + $permalink = $this->xpath($pattern_permalink, $arguments); + $this->assertFalse(!empty($permalink), 'Permalink link found and rel is not set to nofollow.'); + + $this->drupalGet('admin/structure/comment/manage/' . $this->commentType->id()); + $this->assertResponse(200, 'The comment type can be accessed at the edit form.'); + + // Change the nofollow back to its default value: TRUE. + $edit = [ + 'nofollow' => TRUE, + ]; + $this->drupalPostForm('admin/structure/comment/manage/' . $this->commentType->id(), $edit, t('Save')); + \Drupal::entityManager()->getStorage('comment_type')->resetCache(['other']); + $this->commentType = CommentType::load('other'); + + // Check the nofollow on the comment page. + $this->drupalGet('comment/' . $comment->id()); + $arguments = [ + ':rel' => 'nofollow', + ]; + $pattern_permalink = '//p[contains(@class,"comment__permalink")]/a[contains(@rel,:rel) and text()="Permalink"]'; + $permalink = $this->xpath($pattern_permalink, $arguments); + $this->assertTrue(!empty($permalink), 'Permalink link found and rel is set to nofollow.'); + + // Check the nofollow on the reply page. + $this->drupalGet('comment/reply/node/' . $testNode->id() . '/comment_other/' . $comment->id()); + $arguments = [ + ':rel' => 'nofollow', + ]; + $pattern_permalink = '//p[contains(@class,"comment__permalink")]/a[contains(@rel,:rel) and text()="Permalink"]'; + $permalink = $this->xpath($pattern_permalink, $arguments); + $this->assertTrue(!empty($permalink), 'Permalink link found and rel is set to nofollow.'); + } + +} diff --git a/core/modules/comment/tests/src/Functional/CommentTypeTest.php b/core/modules/comment/tests/src/Functional/CommentTypeTest.php index 291f9dc..b84f071 100644 --- a/core/modules/comment/tests/src/Functional/CommentTypeTest.php +++ b/core/modules/comment/tests/src/Functional/CommentTypeTest.php @@ -67,6 +67,7 @@ public function testCommentTypeCreation() { 'label' => 'title for foo', 'description' => '', 'target_entity_type_id' => 'node', + 'nofollow' => TRUE, ]; $this->drupalPostForm('admin/structure/comment/types/add', $edit, t('Save')); $comment_type = CommentType::load('foo'); diff --git a/core/modules/comment/tests/src/Kernel/CommentBundlesTest.php b/core/modules/comment/tests/src/Kernel/CommentBundlesTest.php index d907233..de1c84a 100644 --- a/core/modules/comment/tests/src/Kernel/CommentBundlesTest.php +++ b/core/modules/comment/tests/src/Kernel/CommentBundlesTest.php @@ -51,6 +51,7 @@ protected function setUp() { 'id' => 'comment_on_' . $id, 'label' => 'Comment on ' . $label, 'target_entity_type_id' => $id, + 'nofollow' => TRUE, ])->save(); } } diff --git a/core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php b/core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php index 1e0fd72..0d7c377 100644 --- a/core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php +++ b/core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php @@ -99,6 +99,7 @@ public function testAccessToAdministrativeFields() { 'label' => 'Default comments', 'description' => 'Default comment field', 'target_entity_type_id' => 'entity_test', + 'nofollow' => TRUE, ]); $comment_type->save(); diff --git a/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php b/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php index af73034..8db24e4 100644 --- a/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php +++ b/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php @@ -37,6 +37,7 @@ protected function setUp() { CommentType::create([ 'id' => 'comment', 'label' => $this->randomString(), + 'nofollow' => TRUE, ])->save(); } diff --git a/core/modules/comment/tests/src/Kernel/CommentStringIdEntitiesTest.php b/core/modules/comment/tests/src/Kernel/CommentStringIdEntitiesTest.php index adbe1b0..2f6519c 100644 --- a/core/modules/comment/tests/src/Kernel/CommentStringIdEntitiesTest.php +++ b/core/modules/comment/tests/src/Kernel/CommentStringIdEntitiesTest.php @@ -45,6 +45,7 @@ public function testCommentFieldNonStringId() { 'label' => 'foo', 'description' => '', 'target_entity_type_id' => 'entity_test_string_id', + 'nofollow' => TRUE, ]); $bundle->save(); $field_storage = FieldStorageConfig::create([ diff --git a/core/modules/comment/tests/src/Kernel/CommentValidationTest.php b/core/modules/comment/tests/src/Kernel/CommentValidationTest.php index 98b7715..fe6eae6 100644 --- a/core/modules/comment/tests/src/Kernel/CommentValidationTest.php +++ b/core/modules/comment/tests/src/Kernel/CommentValidationTest.php @@ -42,6 +42,7 @@ public function testValidation() { 'id' => 'comment', 'label' => 'comment', 'target_entity_type_id' => 'node', + 'nofollow' => TRUE, ])->save(); // Add comment field to content. diff --git a/core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php b/core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php index 3b06742..516593e 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php @@ -49,6 +49,7 @@ protected function setUp() { 'id' => 'testcommenttype', 'label' => 'Test comment type', 'target_entity_type_id' => 'node', + 'nofollow' => TRUE, ])->save(); } diff --git a/core/modules/comment/tests/src/Kernel/Views/CommentAdminViewTest.php b/core/modules/comment/tests/src/Kernel/Views/CommentAdminViewTest.php index 86e8949..f9c553d 100644 --- a/core/modules/comment/tests/src/Kernel/Views/CommentAdminViewTest.php +++ b/core/modules/comment/tests/src/Kernel/Views/CommentAdminViewTest.php @@ -87,6 +87,7 @@ protected function setUp($import_test_views = TRUE) { 'label' => 'Default comments', 'target_entity_type_id' => 'entity_test', 'description' => 'Default comment field', + 'nofollow' => TRUE, ])->save(); // Create a commented entity. $entity = EntityTest::create(); diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php index 576e86a..e4ea59a 100644 --- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php @@ -42,26 +42,32 @@ protected function setUp() { CommentType::create([ 'id' => 'comment_node_page', 'label' => $this->randomMachineName(), + 'nofollow' => TRUE, ])->save(); CommentType::create([ 'id' => 'comment_node_article', 'label' => $this->randomMachineName(), + 'nofollow' => TRUE, ])->save(); CommentType::create([ 'id' => 'comment_node_blog', 'label' => $this->randomMachineName(), + 'nofollow' => TRUE, ])->save(); CommentType::create([ 'id' => 'comment_node_book', 'label' => $this->randomMachineName(), + 'nofollow' => TRUE, ])->save(); CommentType::create([ 'id' => 'comment_forum', 'label' => $this->randomMachineName(), + 'nofollow' => TRUE, ])->save(); CommentType::create([ 'id' => 'comment_node_test_content_type', 'label' => $this->randomMachineName(), + 'nofollow' => TRUE, ])->save(); NodeType::create([ diff --git a/core/modules/forum/config/optional/comment.type.comment_forum.yml b/core/modules/forum/config/optional/comment.type.comment_forum.yml index 44a2d65..825c92a 100644 --- a/core/modules/forum/config/optional/comment.type.comment_forum.yml +++ b/core/modules/forum/config/optional/comment.type.comment_forum.yml @@ -8,3 +8,4 @@ id: comment_forum label: Comment_forum target_entity_type_id: node description: 'Default comment field' +nofollow: TRUE diff --git a/core/modules/migrate/tests/src/Kernel/NodeCommentCombinationTrait.php b/core/modules/migrate/tests/src/Kernel/NodeCommentCombinationTrait.php index 6f04b3a..f4b6939 100644 --- a/core/modules/migrate/tests/src/Kernel/NodeCommentCombinationTrait.php +++ b/core/modules/migrate/tests/src/Kernel/NodeCommentCombinationTrait.php @@ -32,6 +32,7 @@ protected function createNodeCommentCombination($node_type, $comment_type = NULL 'id' => $comment_type, 'label' => $this->randomString(), 'target_entity_type_id' => 'node', + 'nofollow' => TRUE, ])->save(); } diff --git a/core/modules/rest/tests/src/Functional/EntityResource/CommentType/CommentTypeResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/CommentType/CommentTypeResourceTestBase.php index 9d88211..968998a 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/CommentType/CommentTypeResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/CommentType/CommentTypeResourceTestBase.php @@ -44,6 +44,7 @@ protected function createEntity() { 'label' => 'Camelids', 'description' => 'Camelids are large, strictly herbivorous animals with slender necks and long legs.', 'target_entity_type_id' => 'node', + 'nofollow' => TRUE, ]); $camelids->save(); @@ -63,6 +64,7 @@ protected function getExpectedNormalizedEntity() { 'langcode' => 'en', 'status' => TRUE, 'target_entity_type_id' => 'node', + 'nofollow' => TRUE, 'uuid' => $this->entity->uuid(), ]; } diff --git a/core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php b/core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php index 4929c7e..e826bca 100644 --- a/core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php +++ b/core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php @@ -47,6 +47,7 @@ protected function setUp($import_test_views = TRUE) { 'label' => 'Comment settings', 'description' => 'Comment settings', 'target_entity_type_id' => 'node', + 'nofollow' => TRUE, ]); $comment_type->save(); diff --git a/core/profiles/standard/config/install/comment.type.comment.yml b/core/profiles/standard/config/install/comment.type.comment.yml index ddcbbc9..e64186f 100644 --- a/core/profiles/standard/config/install/comment.type.comment.yml +++ b/core/profiles/standard/config/install/comment.type.comment.yml @@ -5,3 +5,4 @@ id: comment label: 'Default comments' target_entity_type_id: node description: 'Allows commenting on content' +nofollow: TRUE diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayBaseTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayBaseTest.php index ec1a55c..1911dc1 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayBaseTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayBaseTest.php @@ -67,6 +67,7 @@ public function testOnDependencyRemoval() { 'label' => 'entity_test', 'description' => '', 'target_entity_type_id' => 'entity_test', + 'nofollow' => TRUE, ]); $comment_bundle->save(); $comment_display = EntityViewDisplay::create([