Refresh discussion metadata to make sure it's correct

The new Approval extension may hide new posts, in which case we don't
want to increment the comments count/set the last post.
This commit is contained in:
Toby Zerner 2015-09-22 17:57:20 +09:30
parent 394ae32657
commit ab88d94150

View File

@ -38,8 +38,8 @@ class DiscussionMetadataUpdater
$discussion = $event->post->discussion;
if ($discussion && $discussion->exists) {
$discussion->comments_count++;
$discussion->setLastPost($event->post);
$discussion->refreshCommentsCount();
$discussion->refreshLastPost();
$discussion->refreshParticipantsCount();
$discussion->save();
}