mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 14:07:57 +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
7a0299d246
commit
db067c7d87
@ -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…
x
Reference in New Issue
Block a user