diff --git a/core/modules/comment/src/CommentForm.php b/core/modules/comment/src/CommentForm.php index d6b4174..c6b750f 100644 --- a/core/modules/comment/src/CommentForm.php +++ b/core/modules/comment/src/CommentForm.php @@ -111,7 +111,7 @@ public function form(array $form, FormStateInterface $form_state) { // If not replying to a comment, use our dedicated page callback for new // Comments on entities. - if ($entity->tourl()->toString() == $this->currentPath->getPath() && !$comment->id() && !$comment->hasParentComment()) { + if ($entity->toUrl()->toString() == $this->currentPath->getPath() && !$comment->id() && !$comment->hasParentComment()) { $form['#action'] = $this->url('comment.reply', ['entity_type' => $entity->getEntityTypeId(), 'entity' => $entity->id(), 'field_name' => $field_name]); } @@ -403,7 +403,7 @@ public function save(array $form, FormStateInterface $form_state) { drupal_set_message($this->t('Comment: unauthorized comment submitted or comment submitted to a closed post %subject.', ['%subject' => $comment->getSubject()]), 'error'); // Redirect the user to the entity they are commenting on. } - if ($entity->tourl()->toString() == $this->currentPath->getPath() && $uri->access()) { + if ($entity->toUrl()->toString() == $this->currentPath->getPath() && $uri->access()) { $form_state->setRedirectUrl($uri); } } diff --git a/core/modules/comment/tests/src/Functional/CommentBlockContentTest.php b/core/modules/comment/tests/src/Functional/CommentBlockContentTest.php index f178ac3..de4ac15 100644 --- a/core/modules/comment/tests/src/Functional/CommentBlockContentTest.php +++ b/core/modules/comment/tests/src/Functional/CommentBlockContentTest.php @@ -44,7 +44,7 @@ protected function setUp() { $type->save(); block_content_add_body_field($type->id()); CommentType::create([ - 'id' => 'comment', + 'id' => 'block_content_comment_type', 'label' => 'Comment settings', 'description' => 'Comment settings', 'target_entity_type_id' => 'block_content',