diff --git a/core/modules/comment/src/CommentManager.php b/core/modules/comment/src/CommentManager.php index 579034f..548e2df 100644 --- a/core/modules/comment/src/CommentManager.php +++ b/core/modules/comment/src/CommentManager.php @@ -175,7 +175,7 @@ public function addDefaultField($entity_type, $bundle, $field_name = 'comment', // Make sure the instance doesn't already exist. if (!array_key_exists($field_name, $this->entityManager->getFieldDefinitions($entity_type, $bundle))) { $instance = $this->entityManager->getStorage('field_instance_config')->create(array( - 'label' => 'Comment settings', + 'label' => 'Comments', 'description' => '', 'field_name' => $field_name, 'entity_type' => $entity_type, diff --git a/core/modules/comment/src/Plugin/Field/FieldWidget/CommentWidget.php b/core/modules/comment/src/Plugin/Field/FieldWidget/CommentWidget.php index 4b8de0a..f9fdf73 100644 --- a/core/modules/comment/src/Plugin/Field/FieldWidget/CommentWidget.php +++ b/core/modules/comment/src/Plugin/Field/FieldWidget/CommentWidget.php @@ -65,6 +65,9 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen // Get default value from the field instance. $field_default_values = $this->fieldDefinition->getDefaultValue($entity); + // Override widget title to be helpful for end users. + $element['#title'] = $this->t('Comment settings'); + $element += array( '#type' => 'details', // Open the details when the selected value is different to the stored diff --git a/core/modules/comment/src/Tests/CommentNonNodeTest.php b/core/modules/comment/src/Tests/CommentNonNodeTest.php index 870c908..e9d4c4a 100644 --- a/core/modules/comment/src/Tests/CommentNonNodeTest.php +++ b/core/modules/comment/src/Tests/CommentNonNodeTest.php @@ -46,7 +46,7 @@ function setUp() { // Verify that bundles are defined correctly. $bundles = \Drupal::entityManager()->getBundleInfo('comment'); - $this->assertEqual($bundles['comment']['label'], 'Comment settings'); + $this->assertEqual($bundles['comment']['label'], 'Comments'); // Create test user. $this->admin_user = $this->drupalCreateUser(array( @@ -237,7 +237,7 @@ function testCommentFunctionality() { $this->drupalLogin($limited_user); // Test that default field exists. $this->drupalGet('entity_test/structure/entity_test/fields'); - $this->assertText(t('Comment settings')); + $this->assertText(t('Comments')); $this->assertLinkByHref('entity_test/structure/entity_test/fields/entity_test.entity_test.comment'); // Test widget hidden option is not visible when there's no comments. $this->drupalGet('entity_test/structure/entity_test/entity-test/fields/entity_test.entity_test.comment');