comparison core/modules/comment/src/Controller/CommentController.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 7a779792577d
children af1871eacc83
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
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