Opened 13 years ago
Closed 12 years ago
#2130 closed defect (bug) (duplicate)
Importer 'post_status' precedence and priority
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 2.2 |
| Component: | API - Importers | Keywords: | |
| Cc: |
Description
bbPress uses the WordPress wp_posts.post_status value to manage the bbPress CPT's 'Forums', 'Topics' and 'Reply' for moderation, permissions and anti spam management.
When importing forums using the built in bbPress 'Import Forums' tool, multiple instances of wp_posts.post_status are updated with a callback_status routine as the import process as each step of the SQL queries are performed.
Each bbPress CPT type 'Forum', 'Topic' and 'Reply' may use one of the valid fields below as the 'status' (wp_posts.post_status) for the CPT.
- publish
- draft
- spam
- trash
- closed
- private
- hidden
- inherit
During the import steps we need to set the priority/order/precedence of each of these values for wp_posts.post_status
Examples:
- 'closed' has higher precedence than 'publish'
- 'spam' has higher precedence than 'publish', 'closed', 'private' and 'hidden'
- 'trash' has a higher precedence than 'spam'
eg. bbPress1.php
Post Status - Spam/Trash/Publish
Topic Status - Open/Closed
Reply Status - Spam/Trash/Publish
Currently callback_status is only looking at values for 'spam', 'trash' and 'publish'. In #2125 callback_topic_status was added to update post_status for 'closed' topics and has no checks in place and will overwrite any 'spam' or 'trash' values with 'publish' or 'closed'
What is needed is a single routine for callback_status that includes all the cases above as during import we do not want to update post_status with a 'closed' value if the topic was already 'trash'
Change History (4)
#3
@
12 years ago
Had another look at this today... No luck...
Problem is we are importing two fields to a single field:
- FROM
bb_topics.topic_statusforSpam/Trash/Publishtopic status - FROM
bb_topics.topic_openforClosed/Publish - TO
wp_posts.post_statusforpublish/draft/spam/trash/closed/private/hidden/inherit
Quite tempted to resolve this as 'wont fix' and leave the necessary docs caveat that any 'closed' topics when imported will not be imported as 'closed' and must manually be done to topics after import (Far higher priority should be given to the trash/spam status of the topic IMHO).
Moving to 2.4 to focus on the importers then.