[wp-trac] [WordPress Trac] #20548: xmlrpc "getrecentposts" inconsistent with "getpost"

WordPress Trac wp-trac at lists.automattic.com
Thu Apr 26 02:17:31 UTC 2012


#20548: xmlrpc "getrecentposts" inconsistent with "getpost"
--------------------------+------------------------------
 Reporter:  kevbo         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  XML-RPC       |     Version:  3.1
 Severity:  minor         |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by kevbo):

 Thanks for the API catch.

 I can only ever find the post ID referred to as an integer, even in the
 metaWeblog API spec. See the link "response" here:
 http://xmlrpc.scripting.com/metaWeblogApi.html#requestAndResponse

 {{{
 <member>
         <name>postid</name>
         <value>
                 <i4>1829</i4>
         </value>
 </member>
 }}}

 In any case, I believe that both getPost and getRecentPosts should return
 the same array sub-types, don't you? Actually, the blogger implementation
 (blogger_getPost and blogger_getRecentPosts) returns a post ID as string
 for both functions. However, the metaWeblog doesn't (mw_getPost is int,
 mw_getRecentPosts is string.)

 My client broke when I updated from a pre 3.1 WordPress install to the
 most recent one. Smart client developers will hopefully catch and cast the
 XML-RPC response; mine didn't. I think that some clients may break, but
 that shouldn't prevent us from being consistent in the code.

 (BTW, I'm now unsure if it's actually since 3.1. I'll investigate.)

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20548#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list