Skip to:

Opened 5 years ago

Closed 5 years ago

#2945 closed defect (fixed)

Post revisions are not deleted when resetting the forums

Reported by: netweb Owned by: netweb
Milestone: 2.6 Priority: normal
Severity: normal Version:
Component: Tools Keywords: needs-unit-tests has-patch


Running the "Reset Forums" tool deletes all bbPress posts (forums, topics, and replies) but does not delete any of the post revisions if there were any for their respective posts.

This should be a relatively easy fix in bbp_admin_reset_handler(), currently we get an array of bbPress post ID's and loop through each of those to delete each wp_postmeta value, we should be able to do the same for each post revision in wp_posts by matching the post_parent with post ID.

Attached is a quick patch that should work fine, some unit tests will to confirm nothing untoward occurs are needed.

Attachments (1)

2945.diff (1.3 KB) - added by netweb 5 years ago.

Download all attachments as: .zip

Change History (3)

5 years ago

#1 @netweb
5 years ago

  • Milestone changed from Under Consideration to 2.6

#2 @netweb
5 years ago

  • Owner set to netweb
  • Resolution set to fixed
  • Status changed from new to closed

In 6091:

Tools: Running the "Reset Forums" tool now deletes bbPress' custom post type revisions from the database.

This changeset adds support for deleting forum, topic, and reply post types revisions to bbp_admin_reset_handler().

Fixes #2945.

Note: See TracTickets for help on using tickets.