Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#7287 closed defect (bug) (fixed)

XML-RPC: metaWeblog.getRecentPosts returns a fault code (500) when there are no posts

Reported by: josephscott Owned by:
Milestone: 2.7 Priority: normal
Severity: normal Version:
Component: XML-RPC Keywords:
Focuses: Cc:


If there are no posts when you call the XML-RPC method metaWeblog.getRecentPosts it will return an error condition, with a fault code of 500. This seems rather pointless, since there's no real error. My suggestion would be to just return an empty list and let the client on their end decide what they want to do when there are no posts.

Attachments (1)

xmlrpc.php.diff (434 bytes) - added by josephscott 10 years ago.

Download all attachments as: .zip

Change History (4)

#1 @redsweater
10 years ago

  • Cc redsweater added

Interesting case. I agree with your assessment.

#2 @josephscott
10 years ago

Patch to change this behavior, when there are no posts just return an empty array.

#3 @ryan
10 years ago

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

(In [9133]) Return empty post list instead of fault code when there are no posts. Props josephscott. fixes #7287

Note: See TracTickets for help on using tickets.