MyBB Community Forums
[Pushed] Moderation Queue Delete Posts Doesn't Always Work - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Development (https://community.mybb.com/forum-161.html)
+--- Forum: MyBB 1.8 Development (https://community.mybb.com/forum-165.html)
+---- Forum: 1.8 Bugs and Issues (https://community.mybb.com/forum-157.html)
+----- Forum: Pushed (https://community.mybb.com/forum-183.html)
+----- Thread: [Pushed] Moderation Queue Delete Posts Doesn't Always Work (/thread-222078.html)



Moderation Queue Delete Posts Doesn't Always Work - dragonexpert - 2019-02-23

So if we look at the code on Github in moderation.php you will notice that if soft delete is not enabled, posts will not actually be deleted.


RE: Moderation Queue Delete Posts Doesn't Always Work - effone - 2019-02-23

If soft delete is not enabled this line deletes the post permanently:
https://github.com/mybb/mybb/blob/feature/modcp.php#L2059


RE: Moderation Queue Delete Posts Doesn't Always Work - dragonexpert - 2019-02-24

It is very weird how that isn't by the other condition.


RE: Moderation Queue Delete Posts Doesn't Always Work - effone - 2019-02-24

Yes it is. Was no need to pass through similar condition loops just for the sake of making single log line.
But the code is correct and doing the job.

Also foreach can / should be optimized to single query with multiple pids. Its a huge number of queries if we are deleting many posts at once.


RE: Moderation Queue Delete Posts Doesn't Always Work - dragonexpert - 2019-02-24

(2019-02-24, 05:43 AM)effone Wrote: Yes it is. Was no need to pass through similar condition loops just for the sake of making single log line.
But the code is correct and doing the job.

Also foreach can / should be optimized to single query with multiple pids. Its a huge number of queries if we are deleting many posts at once.

I might address this in my plugin for Restoring Soft Deleted Threads and Posts. I'm thinking doing a select query on posts using an IN clause with pids to get the list of threads and forums that need to be updated. After that run a delete query with an IN clause so all posts can be deleted in one go. Then update the affected threads. Finally, update the affected forums. This should significantly reduce the number of queries.


RE: Moderation Queue Delete Posts Doesn't Always Work - Ben - 2019-03-14

Hi,

Thank you for your report. We have pushed this issue to our Github repository for further analysis where you can track our commits and progress with fixing this bug. Discussions regarding this bug may also take place there too.

Follow this link to visit the issue on Github: https://github.com/mybb/mybb/issues/3612

Thanks for contributing to MyBB!

Regards,
The MyBB Group


RE: Moderation Queue Delete Posts Doesn't Always Work - effone - 2019-03-14

Boom. Its not a bug.
Why pushed? Does anyone care this performance impact.?
No one even noticed in like 5 yrs.

Well, as I said, it should be improved. Yeah...