-
-
Notifications
You must be signed in to change notification settings - Fork 834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Post events increasing post count #1695
Comments
The issue seems to be that https://github.com/flarum/core/blob/master/src/User/User.php#L756 |
Honestly why is there |
Performance and DB load, basically. Sometimes a little bit of extra work when inserting pays off greatly when reading. You just have to be extra careful to sync correctly when inserting, as this issue shows. 😉 |
This comment has been minimized.
This comment has been minimized.
This should be an easy fix. Just change $this->comment_count = $this->posts()->count(); to $this->comment_count = $this->posts()->where('type', 'comment')->count(); |
What about |
True, didn't think about that. |
What if we had a UserMeta collection/class that would be extensible. In addition the default values, like I'm not too fond of more complexity, but it might be interesting to be able to create such statistical meta information on models. |
… on all posts, including events
Bug Report
Current Behavior
Post count increases by one for Post Events, counted after post is made following the post event. See this thread on discuss for more information and demonstration links.
Steps to Reproduce
Expected Behavior
In step 5, post count should only reflect previous count + 1, post events should not count
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
The text was updated successfully, but these errors were encountered: