• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Deleting reported items

Onimua

Well-known member
#1
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?
 

Onimua

Well-known member
#2
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:
 

Mike

XenForo developer
Staff member
#4
It's intentional. It'd be rather pointless to remove the report that triggered the removal of the content.
 
R

ragtek

Guest
#5
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$
 

D.O.A.

Well-known member
#6
*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 :)
 

Jake Bunce

XenForo moderator
Staff member
#7
Does anyone have a easy method of deleting the old reported posts?
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;
 

Reterg

New member
#8
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.
 

Jake Bunce

XenForo moderator
Staff member
#10
What about deleting all reports older than 1 day? or 2 days?
Change the number of 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;
 

TheLaw

Well-known member
#11
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.
 
#13
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?
 
#16
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