1
0
mirror of https://github.com/flarum/core.git synced 2025-08-05 16:07:34 +02:00

Fix regressions related to deleting posts

- On the front-end, correct the check to see if the discussion has no more posts
- On the back-end, run a query to count the posts instead of using the comments_count, because the comments_count does not include other deleted posts
This commit is contained in:
Toby Zerner
2016-02-29 18:41:27 +10:30
parent 730a46d885
commit b0b388052a
3 changed files with 3 additions and 3 deletions

View File

@@ -54,7 +54,7 @@ class DiscussionMetadataUpdater
$discussion = $event->post->discussion;
if ($discussion->comments_count === 0) {
if ($discussion->posts()->count() === 0) {
$discussion->delete();
}
}