Loading core/modules/comment/comment.routing.yml +1 −1 Changes for core/modules/comment/comment.routing.yml: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -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\Core\Entity\Controller\EntityController::title' requirements: _entity_access: 'comment_type.update' options: Loading core/modules/comment/src/CommentTypeForm.php +4 −0 Changes for core/modules/comment/src/CommentTypeForm.php: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -74,6 +74,10 @@ public function form(array $form, FormStateInterface $form_state) { $comment_type = $this->entity; if ($this->operation === 'edit') { $form['#title'] = $this->t('Edit %label comment type', ['%label' => $comment_type->label()]); } $form['label'] = [ '#type' => 'textfield', '#title' => $this->t('Label'), Loading core/modules/comment/tests/src/Functional/CommentTypeTest.php +5 −0 Changes for core/modules/comment/tests/src/Functional/CommentTypeTest.php: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ protected function setUp(): void { parent::setUp(); $this->drupalPlaceBlock('page_title_block'); $this->drupalPlaceBlock('system_breadcrumb_block'); $this->adminUser = $this->drupalCreateUser($this->permissions); } Loading @@ -67,6 +68,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', "Edit {$comment_type->label()} comment type"); // Create a comment type via the user interface. $edit = [ Loading @@ -81,6 +83,9 @@ public function testCommentTypeCreation() { // Asserts that form submit redirects to the expected manage fields page. $this->assertSession()->addressEquals('admin/structure/comment/manage/' . $edit['id'] . '/fields'); // Asserts that the comment type is visible in breadcrumb. $this->assertTrue($this->assertSession()->elementExists('css', 'nav[role="navigation"]')->hasLink('title for foo')); $comment_type = CommentType::load('foo'); $this->assertInstanceOf(CommentType::class, $comment_type); Loading Loading
core/modules/comment/comment.routing.yml +1 −1 Changes for core/modules/comment/comment.routing.yml: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -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\Core\Entity\Controller\EntityController::title' requirements: _entity_access: 'comment_type.update' options: Loading
core/modules/comment/src/CommentTypeForm.php +4 −0 Changes for core/modules/comment/src/CommentTypeForm.php: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -74,6 +74,10 @@ public function form(array $form, FormStateInterface $form_state) { $comment_type = $this->entity; if ($this->operation === 'edit') { $form['#title'] = $this->t('Edit %label comment type', ['%label' => $comment_type->label()]); } $form['label'] = [ '#type' => 'textfield', '#title' => $this->t('Label'), Loading
core/modules/comment/tests/src/Functional/CommentTypeTest.php +5 −0 Changes for core/modules/comment/tests/src/Functional/CommentTypeTest.php: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ protected function setUp(): void { parent::setUp(); $this->drupalPlaceBlock('page_title_block'); $this->drupalPlaceBlock('system_breadcrumb_block'); $this->adminUser = $this->drupalCreateUser($this->permissions); } Loading @@ -67,6 +68,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', "Edit {$comment_type->label()} comment type"); // Create a comment type via the user interface. $edit = [ Loading @@ -81,6 +83,9 @@ public function testCommentTypeCreation() { // Asserts that form submit redirects to the expected manage fields page. $this->assertSession()->addressEquals('admin/structure/comment/manage/' . $edit['id'] . '/fields'); // Asserts that the comment type is visible in breadcrumb. $this->assertTrue($this->assertSession()->elementExists('css', 'nav[role="navigation"]')->hasLink('title for foo')); $comment_type = CommentType::load('foo'); $this->assertInstanceOf(CommentType::class, $comment_type); Loading