#18869 closed defect (bug) (fixed)
XML-RPC returns wp_author_id as int instead of string
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.3 | Priority: | normal |
Severity: | normal | Version: | 3.3 |
Component: | XML-RPC | Keywords: | has-patch |
Focuses: | Cc: |
Description
Following r18597, we now cast the user id to int when initializing the WP_User data.
That value is directly used by the XML-RPC methods to return 'wp_author_id', which is expected to be string.
Patch attached fixes three occurrences -there might be more, and we need to review all the xmlrpc apis that return user ids.
Attachments (1)
Change History (9)
#3
@
13 years ago
- Owner set to ryan
- Resolution set to fixed
- Status changed from new to closed
In [19071]:
#4
follow-up:
↓ 5
@
13 years ago
- Cc jbernal@… added
I'm a bit late to the party, but documentation says wp_author_id is an int: http://codex.wordpress.org/XML-RPC
But more important, changing XML-RPC data types is the easiest way to break current apps, so please try to avoid it. If you must, please ping the wp-xmlrpc mailing list.
#5
in reply to:
↑ 4
;
follow-up:
↓ 6
@
13 years ago
Replying to koke:
I'm a bit late to the party, but documentation says wp_author_id is an int: http://codex.wordpress.org/XML-RPC
Updated Codex page.
#6
in reply to:
↑ 5
;
follow-up:
↓ 7
@
13 years ago
Replying to SergeyBiryukov:
Updated Codex page.
My point was that the codex said it was an int, so many apps out there would already expect that. Changing it breaks compatibility
#7
in reply to:
↑ 6
@
13 years ago
- Cc ercoli@… added
Replying to koke:
My point was that the codex said it was an int, so many apps out there would already expect that. Changing it breaks compatibility
You're right, but we need to return wp_author_id as a string, since WP breaks the XML-RPC spec for large user ids.
#8
@
13 years ago
Replying to koke:
Replying to SergeyBiryukov:
Updated Codex page.
My point was that the codex said it was an int, so many apps out there would already expect that. Changing it breaks compatibility
I think the codex documentation was incorrect.
I just tested with WordPress 3.3, 3.2, 3.1, 3.0, and 2.9 and we returned a string for wp_author_id
when calling wp.getPage
.
This matches what we do with other IDs and has been soaking on wp.com for three weeks.