mirror of
https://github.com/flarum/framework.git
synced 2024-12-13 15:13:42 +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;
|
$discussion = $event->post->discussion;
|
||||||
|
|
||||||
if ($discussion && $discussion->exists) {
|
if ($discussion && $discussion->exists) {
|
||||||
$discussion->comments_count++;
|
$discussion->refreshCommentsCount();
|
||||||
$discussion->setLastPost($event->post);
|
$discussion->refreshLastPost();
|
||||||
$discussion->refreshParticipantsCount();
|
$discussion->refreshParticipantsCount();
|
||||||
$discussion->save();
|
$discussion->save();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user