Make WordPress Core

Opened 15 years ago

Closed 9 years ago

#10764 closed defect (bug) (fixed)

XML- RPC, blogger_editPost, Publish Status not working

Reported by: bobby_drk's profile bobby_drk Owned by: wonderboymusic's profile wonderboymusic
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: XML-RPC Keywords: has-patch
Focuses: Cc:


In the blogger_editPost function in xmlrpc.php is not working properly. Currently you cannot change publish status. It looks like we are missing a line of code.

$post_status = ($publish) ? 'publish' : 'draft';

When I inserted this line into the function before the

$postdata = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt');

I was able to gain control of the publish status.

Attachments (1)

10764.diff (518 bytes) - added by mdawaffe 13 years ago.

Download all attachments as: .zip

Change History (10)

#1 @redsweater
15 years ago

I agree there appears to be a problem with the blogger_editPost method.

Something like what bobby_drk suggested sounds like a good fix, but you should be careful to add the proposed line a bit earlier, before the first line that tests against post_status

if ( ('publish' == $post_status) && !current_user_can('publish_posts') )

I suspect this has not generally caused problems because very, very few clients probably use the blogger_editPost method. bobby_drk, if you can help it I would recommend not using it, and instead using the metaweblog variant. That will get things working for you instantly without having to wait for the patch to go through.

#2 @redsweater
15 years ago

  • Cc jalkut@… added

#3 @josephscott
15 years ago

  • Cc josephscott added

This brings up the question of keeping the blogger.* methods up to date with the changes/updates/improvements that have been done with metaWeblog.* methods. I'm inclined to say no and direct people to using the metaWeblog.* methods instead.

#4 @nacin
14 years ago

  • Keywords close added

13 years ago

#5 @mdawaffe
13 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to Future Release

If the methods don't work, we should either fix them or remove them.

#6 @markoheijnen
12 years ago

  • Keywords dev-feedback added; close removed

I agree with mdawaffe. The method should be fixed or blogger API should be removed.
The patch does needs a look and unit tests before it get committed

#8 @wonderboymusic
9 years ago

  • Keywords dev-feedback removed
  • Milestone changed from Future Release to 4.4
  • Owner changed from josephscott to wonderboymusic
  • Status changed from new to assigned

#9 @wonderboymusic
9 years ago

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

In 34573:

XML-RPC: In wp_xmlrpc_server::blogger_editPost(), make use of the $publish arg (the 6th arg passed to the method) to specify publish or draft. Restores the arg, which I removed in [31092], because it was unused cruft.

Props mdawaffe.
Fixes #10764.

Note: See TracTickets for help on using tickets.