MyBB Community Forums

Full Version: Odd miscounting of reports
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Just noticed here while viewing the reports:

[attachment=34653]
[attachment=34654]

As you can see the post in "Real Forums" is shown with 2 reports and the other one with one report. However the "All Reports" page shows two reports for the other report (Note: the same user reported it twice with two different reasons). Looking through the code now to see how exactly those numbers are calculated.
first report was by me and the second one by the topic starter !
Edit: multiple report reasons are not stored in the database

IIRC, in MyBB 1.8, earlier a post could be reported only once
looks like it is broken in the recent versions of MyBB
If only one reason should be saved the reports for "Change post url" should be automatically merged.
^ oh, I mean to say, for a specific post, report reason is stored only once
Yeah, both reports are for the exact same post.
The problem is with this code: https://github.com/mybb/mybb/blob/featur...p#L135-147 Due to the reportstatus condition this check: https://github.com/mybb/mybb/blob/featur...t.php#L159 fails and add_report() is executed instead of update_report() so that the report is visible as unread again.

So it lets you report something when the previous report was marked as read - but why? IMO shouldn't be the case, if moderation thinks that a report was invalid, it doesn't make any sens to let people still report the same thing over and over again. The only fix except disallowing that would be marking the old report as unread instead of inserting a new one.
It should still be possible to report a post again (eg a potential spammer writes a post, someone reports it, moderator thinks it's not spam, spammer edits his post). Seems like one of those things we don't want to change in a minor release as a few other places would need to be changed too.
(2015-09-22, 11:29 AM)JonesĀ H Wrote: [ -> ]spammer edits his post

Ah yes, forgot about edits.

So we should probably use the other fix I mentioned above - remove reportstatus != '1' condition from the query, change update_report() to also update reportstatus column to 0 (so mark as unread), stop adding the UID https://github.com/mybb/mybb/blob/featur...t.php#L162 if it's already in array or equal to uid column and possibly stop showing this error: https://github.com/mybb/mybb/blob/featur...t.php#L143 if reportstatus is 1. This won't cause any problems if I'm not mistaken.
As multiple people confirmed that there's an issue here can we push this?
Sure.
Pages: 1 2