diff --git a/core/modules/comment/comment.routing.yml b/core/modules/comment/comment.routing.yml index e92e8daf79..d9f0ff89d9 100644 --- a/core/modules/comment/comment.routing.yml +++ b/core/modules/comment/comment.routing.yml @@ -135,7 +135,7 @@ entity.comment_type.edit_form: path: '/admin/structure/comment/manage/{comment_type}' defaults: _entity_form: 'comment_type.edit' - _title: 'Edit' + _title_callback: '\Drupal\comment\Controller\CommentTypeController::commentTypeTitle' requirements: _entity_access: 'comment_type.update' options: diff --git a/core/modules/comment/src/Controller/CommentTypeController.php b/core/modules/comment/src/Controller/CommentTypeController.php new file mode 100644 index 0000000000..0dc5c5d5a4 --- /dev/null +++ b/core/modules/comment/src/Controller/CommentTypeController.php @@ -0,0 +1,26 @@ +label(); + } + +} diff --git a/core/modules/comment/tests/src/Functional/CommentTypeTest.php b/core/modules/comment/tests/src/Functional/CommentTypeTest.php index 1fd9be1fa5..225dd1fbfc 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() { // Ensure that the new comment type admin page can be accessed. $this->drupalGet('admin/structure/comment/manage/' . $type->id()); $this->assertSession()->statusCodeEquals(200); + $this->assertSession()->elementTextEquals('css', 'h1', $comment_type->label()); // Create a comment type via the user interface. $edit = [