Make WordPress Core

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#7772 closed defect (bug) (fixed)

XMLRPC interface doesn't reflect enclosures back as <enclosure> attributes

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


The new enclosure support in WP 2.6 accepts an enclosure specified as an <enclosure> element on a submitted post, but doesn't advertise the presence of that enclosure as an <enclosure> element on get requests.

Instead, the enclosures are represented as custom field attributes, which is probably fine, but which doesn't provide a valid way for a basic XMLRPC MetaWeblog client to get at the existing enclosure value on a given post.

I am not sure whether only the first enclosure should be exhibited as an <enclosure> element, or whether all of them should be. But the <enclosure> element should be used to convey an existing enclosure item to XMLRPC MetaWeblog clients.


Attachments (2)

7772.diff (1.0 KB) - added by Otto42 16 years ago.
First attempt at a patch
7772.2.diff (1.0 KB) - added by Otto42 16 years ago.
Attempt number two…

Download all attachments as: .zip

Change History (10)

#1 @Otto42
16 years ago

Attached a patch that I think will do the job, but I don't know any easy way to test it. Do you know of a client that works well with enclosures like this?

16 years ago

First attempt at a patch

#2 @josephscott
16 years ago

One question about the patch, what happens if there's more than one enclosure for the post?

#3 follow-up: @Otto42
16 years ago

This patch only gets the first one. Notice the "break 2;" line to stop once it gets one.

16 years ago

Attempt number two...

#4 in reply to: ↑ 3 @josephscott
16 years ago

Replying to Otto42:

This patch only gets the first one. Notice the "break 2;" line to stop once it gets one.

That was my point :-)

Do clients (and the API for that matter) expect there to only ever be one enclosure per post?

#5 @Otto42
16 years ago

I was only going by what the original request in the ticket was. If we want it to have more than one enclosure, then we need to know what clients expect as far as that goes.

#6 @josephscott
16 years ago

Good point, seems like limiting it to one is the right thing to do at this point.

#7 @ryan
16 years ago

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

(In [9089]) Return enclosure data in mw_getPosts(). Props Otto42. fixes #7772

#8 @ryan
16 years ago

  • Milestone changed from 2.8 to 2.7
Note: See TracTickets for help on using tickets.