Ticket #7772 (closed defect: fixed)

Opened 2 months ago

Last modified 2 months ago

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

Reported by: redsweater Assigned to: josephscott
Priority: normal Milestone: 2.7
Component: XML-RPC Version:
Severity: normal Keywords:
Cc: redsweater

Description

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.

Daniel

Attachments

7772.diff (1.0 kB) - added by Otto42 on 09/22/08 16:31:02.
First attempt at a patch
7772.2.diff (1.0 kB) - added by Otto42 on 09/22/08 16:37:34.
Attempt number two…

Change History

09/22/08 16:23:41 changed by Otto42

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?

09/22/08 16:31:02 changed by Otto42

  • attachment 7772.diff added.

First attempt at a patch

09/22/08 16:33:07 changed by josephscott

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

(follow-up: ↓ 4 ) 09/22/08 16:36:02 changed by Otto42

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

09/22/08 16:37:34 changed by Otto42

  • attachment 7772.2.diff added.

Attempt number two...

(in reply to: ↑ 3 ) 09/22/08 18:20:09 changed by josephscott

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?

09/22/08 18:38:06 changed by Otto42

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.

09/24/08 21:45:01 changed by josephscott

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

10/06/08 19:20:51 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

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

10/06/08 19:21:04 changed by ryan

  • milestone changed from 2.8 to 2.7.