WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#4670 closed defect (bug) (fixed)

When updating a post via Atom-PP draft/published status is not handled properly

Reported by: placey Owned by:
Milestone: 2.3 Priority: normal
Severity: normal Version: 2.2
Component: General Keywords: app atom-pp draft pulish put entry needs-patch
Focuses: Cc:

Description

When using APP, if a draft post is updated so as to no longer be a draft, that change is not detected and the post remains in draft state. The problem is in the put_post function in wp-app.php. There is a section that reads as follows:

$publish = (isset($parsed->draft) && trim($parsed->draft) == 'yes') ? false : true;
...
// let's not go backwards and make something draft again.
if(!$publish && $post_status == 'draft') {
        $post_status = ($publish) ? 'publish' : 'draft';
}

The negation of the $publish variable in the if statement is incorrect (I think). It should be:

if($publish && $post_status == 'draft') {
        $post_status = ($publish) ? 'publish' : 'draft';
}

Change History (2)

comment:1 @foolswisdom8 years ago

  • Keywords needs-patch added
  • Milestone set to 2.3 (trunk)

comment:2 @placey8 years ago

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

Fixed as of revision 5951 of wp-app.php.

See ticket # 4191: http://trac.wordpress.org/ticket/4191

Note: See TracTickets for help on using tickets.