Fixed Post counter not updated correctly when moving unapproved post to forum where count_messages is disabled

Steffen

Well-known member
Affected version
2.0.8
1. Reply to an existing thread. This increases your post counter by 1. Fine.

2. Unapprove your post. This decreases your post counter by 1. Still fine.

(As an alternative to these two steps, post as a user whose messages need to be approved.)

3. Now move your post to a forum where the option "count_messages" ("Count messages posted in this forum toward user total") is disabled.

For some reason, moving an unapproved post auto-approves it (is this intended?) and it increases the post counter by 1. Even if the auto-approval is intended, the post counter shouldn't be increased (because "count_messages" is disabled in the target forum).

(If you move the whole thread instead of a single post then everything works as expected: The post isn't auto-approved and the post counter remains unchanged.)
 
This is fixed now. The underlying issue was that Entity::setAsSaved wasn't wiping out the cached relation value in this situation, so the code was still behaving as if the post was in the old thread.

For some reason, moving an unapproved post auto-approves it (is this intended?)
I presume you're moving the post to a new thread (or it's going to be the first post of the target thread). If so, then the approval is expected. The first post in a thread is always visible. (Its state would generally be controlled by the thread itself.)
 
Back
Top Bottom