[Pushed] Moderation Queue Delete Posts Doesn't Always Work
#1
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.
Reply
#2
If soft delete is not enabled this line deletes the post permanently:
https://github.com/mybb/mybb/blob/featur....php#L2059
Reply
#3
It is very weird how that isn't by the other condition.
Reply
#4
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.
Reply
#5
(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.
Reply
#6
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
Reply
#7
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...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)