Opened 11 years ago
Closed 10 years ago
#2577 closed defect (bug) (fixed)
Imported closed/locked topics missing 'publish' postmeta `_bbp_status`
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.6 | Priority: | normal |
Severity: | normal | Version: | 2.5.3 |
Component: | API - Importers | Keywords: | |
Cc: |
Description
When a thread in phpBB is locked, it correctly get imported as a closed topic.
However, if you try to Open the imported topic, it's changing to draft instead of published, effectively hiding the topic's content.
Furthermore, if you hit Publish on that topic from the WP backend, it then works properly.
I think I've tracked down the issue. When imported, the locked threads/closed topics don't get a record in the wp_postmeta table, with key _bbp_status and value publish
Once I manually add this (without editing the topic), it's then working correctly.
This also gets created when I re-publish the topic from the WP backend (which I already mentioned, works properly).
Attachments (1)
Change History (11)
#2
@
11 years ago
- Milestone changed from Awaiting Review to 2.6
- Summary changed from phpBB - Locked threads - Closed topics to Imported closed/locked topics missing 'publish' postmeta `_bbp_status`
#3
@
11 years ago
Looking at the way importer currently does it's thing and the way bbPress uses _bbp_status
for topics and forums adding a new _bbp_status
field in wp_postmeta
for every topic is not something we want to do.
In #2347 I added a 'Post Import' repair tool for phpBB anonymous/deleted users so I think I will extend this to also add a if imported forum or topic was closed add _bbp_status = publish section to this tool. I'll try to keep in mind making this work retrospectively for people who have already performed their import.
#4
@
11 years ago
Sure thing. I can't comment on the best approach for a solution, as I've only used bbPress since yesterday, so I'll need to take your word for it.
For reference, the way I fixed my installation is this:
$tmp_posts = new WP_Query(array( 'post_type' => 'topic', 'posts_per_page' => -1, 'post_status' => 'closed', )); while($tmp_posts->have_posts()) { $tmp_posts->the_post(); global $post; $status = get_post_meta($post->ID, '_bbp_status', true); if( empty($status) ) { update_post_meta($post->ID, '_bbp_status', 'publish'); } } wp_reset_postdata(); unset($tmp_posts);
I hope this will shave some seconds of your load :)
#5
@
11 years ago
- Keywords has-patch added
In 2577.diff:
- Add a new repair tool "Recalculate imported closed topics."
I'm going to refresh #2347, I'll probably merge this tool with that tool so the there is only a single 'post import' repair tool.
Confirmed and thanks for this.
I'll work out a patch for this shortly as this affects all the importers that have support for closed or locked topics.