mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 14:13:37 +08:00
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:
parent
394ae32657
commit
ab88d94150
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user