Deleting reported items

Onimua

Well-known member
There doesn't seem to be a way to remove reported items from the front end, but there also doesn't seem to be a quick way to delete items via code either (similar to XenForo_Model_DeletionLog::removeDeletionLog and XenForo_Model_ModerationQueue::deleteFromModerationQueue), is that the case?

Essentially I'm looking to deleted information from xf_report and xf_report_comment if the content is no longer available (hard-deleted from the database), unless there's a specific reason it's not recommended. I could do it via query (fetch report_id from xf_report, then delete records from xf_report_comment using the id) but I wanted to be sure I didn't miss an existing method first. If I do, do I need to be aware of any caches that should be rebuilt after?
 
Upon closer inspection, it seems that if you report a post or thread and hard-delete it, the report isn't removed either. Is this intentional or an oversight? :confused:
 
It's intentional. It'd be rather pointless to remove the report that triggered the removal of the content.
 
I have to disagree.
A short summery in the deletion log would be IMHO much better instead of having still the whole reportentry in the dabase.. (that's also something i can't understand. If the user softdeletes an thread/post, he can post a reason, but if he harddeletes it, there's no reason.)

my 0.02$
 
*bump*

Does anyone have a easy method of deleting the old reported posts? we don't need a permanent record/capture of the indecent content we've dealt with and perma-deleted. We also make great use of our report function (well.. our members do) and having page after page of "dealt with" reports from months ago seems totally unnecessary.

Add a delete button please, for some of us the need to have a forever's worth of report history is not that wanted, the post is gone, the report is now a useless entry/reminder of what once was :)
 
When viewing a report, there should be a button on the side bar titled "Claim and handle report"
Click it, then select it as resolved.
That will remove it from the list of reported items.
 
What about deleting all reports older than 1 day? or 2 days?

Change the number of days:

Rich (BB code):
DELETE
FROM xf_report
WHERE last_modified_date < UNIX_TIMESTAMP() - 30*86400;

DELETE rc.*
FROM xf_report_comment AS rc
LEFT JOIN xf_report AS r ON (r.report_id = rc.report_id)
WHERE r.report_id IS NULL;
 
  • Like
Reactions: rdn
Is there an easier way to manage this issue? I see the thread is 2 years old. The problem we're having is that the report shows a number associated with it and doesn't indicate whether it's a new report or current. I don't think it's an addon. For example, same as above. User requests we delete a topic. Topic is deleted but the report still remains along with a number "1" in the admin bar. I don't think it's an addon and pretty sure it's stock XF as described above.
 
Ahhhhh..... I see it now. It's in the sidebar. UI can sometimes be a challenge, such as in this case.
 
Run these queries to prune all reports (and their comments) older than 30 days:

Code:
DELETE
FROM xf_report
WHERE last_modified_date < UNIX_TIMESTAMP() - 30*86400;

DELETE rc.*
FROM xf_report_comment AS rc
LEFT JOIN xf_report AS r ON (r.report_id = rc.report_id)
WHERE r.report_id IS NULL;
Is their an equivelant in mysql?
 
Code:
Failed to execute SQL : SQL DELETE FROM xf_report WHERE last_modified_date < UNIX_TIMESTAMP() - 30*86400; DELETE rc.* FROM xf_report_comment AS rc LEFT JOIN xf_report AS r ON (r.report_id = rc.report_id) WHERE r.report_id IS NULL; failed : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELETE rc.* FROM xf_report_comment AS rc LEFT JOIN xf_report AS r ON (r.report_i' at line 1
 
Top Bottom