[wp-trac] [WordPress Trac] #27090: WordPress XML-RPC method returns error but still posts

WordPress Trac noreply at wordpress.org
Tue Feb 11 15:15:00 UTC 2014


#27090: WordPress XML-RPC method returns error but still posts
--------------------------+------------------------------
 Reporter:  IndigoJo      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  XML-RPC       |     Version:  3.8.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by redsweater):

 The report also suggests that the issue doesn't occur with the older
 metaweblog.newPost method. The window where a proper error could be
 propagated in that scenario is almost identical to the wp.newPost code
 path:
 {{{
 $post_ID = wp_insert_post( $postdata, true );
 if ( is_wp_error( $post_ID ) )
         return new IXR_Error(500, $post_ID->get_error_message());

 if ( !$post_ID )
         return new IXR_Error(500, __('Sorry, your entry could not be
 posted. Something wrong happened.'));

 do_action( 'xmlrpc_call_success_mw_newPost', $post_ID, $args );

 return strval($post_ID);
 }}}

 Which suggests that if there is an issue it's in wp_insert_post itself,
 and that the difference in behavior between wp.newPost and
 metaweblog.newPost has to do with how the $postdata is prepared for
 wp_insert_post.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27090#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list