Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
By andypost on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Introduced in version:
8.0-ALPHA7
Issue links:
Description:
Comment module constants COMMENT_NOT_PUBLISHED
& COMMENT_PUBLISHED
used to indicate a published state of the comment entity has been located in comment.module
.
To clean up and get it under the responsible class, they was renamed and moved to Drupal\comment\CommentInterface
.
Drupal 7 and 8 before the change:
// Unpublish comment.
$comment = $this->commentStorage->load($cid);
$comment->status->value = COMMENT_NOT_PUBLISHED;
$comment->save();
Drupal 8 after:
use Drupal\comment\CommentInterface;
// Unpublish comment.
$comment = $this->commentStorage->load($cid);
$comment->status->value = CommentInterface::NOT_PUBLISHED;
$comment->save();
Impacts:
Module developers