comparison core/modules/comment/src/Controller/CommentController.php @ 4:a9cd425dd02b

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:11:55 +0000
parents c75dbcec494b
children 12f9dff5fda9
comparison
equal deleted inserted replaced
3:307d7a7fd348 4:a9cd425dd02b
80 * A comment entity. 80 * A comment entity.
81 * 81 *
82 * @return \Symfony\Component\HttpFoundation\RedirectResponse 82 * @return \Symfony\Component\HttpFoundation\RedirectResponse
83 */ 83 */
84 public function commentApprove(CommentInterface $comment) { 84 public function commentApprove(CommentInterface $comment) {
85 $comment->setPublished(TRUE); 85 $comment->setPublished();
86 $comment->save(); 86 $comment->save();
87 87
88 drupal_set_message($this->t('Comment approved.')); 88 $this->messenger()->addStatus($this->t('Comment approved.'));
89 $permalink_uri = $comment->permalink(); 89 $permalink_uri = $comment->permalink();
90 $permalink_uri->setAbsolute(); 90 $permalink_uri->setAbsolute();
91 return new RedirectResponse($permalink_uri->toString()); 91 return new RedirectResponse($permalink_uri->toString());
92 } 92 }
93 93