Closed clarkwinkelmann closed 1 year ago
Will this issue be included in milestone 1.7?
probably not
The code does call User::refreshCommentCount(), but on the discussion author rather than the post author. It looks it might have been an error when the code was written since it's not really needed to call that method when approving the first post of a discussion which wouldn't count towards the comment count value.
Actually, looking into the code, even the first post counts toward the comment count value, so it's not an error, it seems that's just the wanted behavior when introduced.
Current Behavior
Approving a reply held for approval does not update the user
comment_count
property.If a user is subject to approval in every tag they have access to, this means their
comment_count
value stays at zero until one of the post is deleted or if a discussion is approved, at which point it'll be recalculated.Steps to Reproduce
comment_count
value.comment_count
value on the test user. The value is still the same as before.Expected Behavior
comment_count
should be updated when a reply is approved.Screenshots
No response
Environment
Output of
php flarum info
Possible Solution
The code does call
User::refreshCommentCount()
, but on the discussion author rather than the post author. It looks it might have been an error when the code was written since it's not really needed to call that method when approving the first post of a discussion which wouldn't count towards the comment count value.https://github.com/flarum/framework/blob/d7b9a03f31847c39631ba495df8f515509774610/extensions/approval/src/Listener/UpdateDiscussionAfterPostApproval.php#L35-L38
Additional Context
Reported here https://discuss.flarum.org/d/25055-first-post-approval/80