diff --git a/core/modules/comment/src/CommentForm.php b/core/modules/comment/src/CommentForm.php index 8421558..7dbbf29 100644 --- a/core/modules/comment/src/CommentForm.php +++ b/core/modules/comment/src/CommentForm.php @@ -370,7 +370,10 @@ public function save(array $form, FormStateInterface $form_state) { $form_state->setValue('cid', $comment->id()); // Add a log entry. - $logger->notice('Comment posted: %subject.', array('%subject' => $comment->getSubject(), 'link' => \Drupal::l(t('View'), 'entity.comment.canonical', array('comment' => $comment->id()), array('fragment' => 'comment-' . $comment->id())))); + $logger->notice('Comment posted: %subject.', array( + '%subject' => $comment->getSubject(), + 'link' => $this->getLinkGenerator()->generateFromUrl(t('View'), $comment->urlInfo()->setOption('fragment', 'comment-' . $comment->id())) + )); // Explain the approval queue if necessary. if (!$comment->isPublished()) {