Rebuilding Forum Counters, doesn't count unapproved threads properly
|Assignee:||Ryan Gordon||% Done:|
|Target version:||1.6.0 Beta|
|Reported In MyBB Version:||1.4.11||Database Version:|
|PHP Version:||SQA assignments:|
For unapproved threads, it just sums the number of approved and unapproved replies but doesn't count the first post in the thread.
- Log in as admin/moderator
- Make new thread in a forum (for simplicity's sake, we'll do it in an empty forum)
- Unapprove this thread
- If the forum was initially empty, the forum counters should now be: Threads: 0 (1), Posts: 0 (1)
- Run a recount forum counters in the AdminCP
- The unapproved post in the count is now gone
Fix should be simple - just add in 1 for the implied unapproved first post in the recount.
#4 Updated by Huji Lee about 4 years ago
- Status changed from Resolved to Feedback
I think there's something wrong here. You're adding $count2['threads'], while you need to add a number of "posts" not "threads". Make sure you don't get correct results just because the change in the number of posts and threads is equal.
PS: I didn't test, I'm just talking based on the code. If I'm wrong, please excuse me.