[wp-trac] [WordPress Trac] #35185: Unable to create Post via XMLRPC after upgrading to 4.4
WordPress Trac
noreply at wordpress.org
Tue Dec 22 08:41:31 UTC 2015
#35185: Unable to create Post via XMLRPC after upgrading to 4.4
-----------------------------+------------------------
Reporter: Sandeep.Prakash | Owner:
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: 4.4.1
Component: XML-RPC | Version: 4.4
Severity: normal | Resolution:
Keywords: | Focuses:
-----------------------------+------------------------
Comment (by dd32):
This is caused by [35509] #16980 cc @wonderboymusic
In short; `mw_newPost` would previously receive:
{{{
Array
(
[title] => Wonderful Thing
[description] => This is the main page content
)
}}}
it now receives:
{{{
Array
(
[wp_password] =>
[permaLink] =>
[mt_keywords] =>
[mt_text_more] =>
[dateCreated] =>
[link] =>
[wp_slug] =>
[mt_allow_comments] =>
[date_created_gmt] =>
[mt_excerpt] =>
[title] => Wonderful Thing
[description] => This is the main page content
[wp_author_display_name] =>
[wp_author_id] =>
[mt_allow_pings] =>
[categories] =>
[userid] =>
[postid] =>
)
}}}
The null/empty values were previously stripped out, which I can understand
would be the expected behaviour.
With this change, it looks like every instance of `isset(
$content_struct[..] )` needs to be changed to `! empty(
$content_struct[...] )`.
I could also argue that the XMLRPC client shouldn't be sending those
fields if it doesn't intend to specify a value, which means the
`WordPress::API` CPAN module needs updating.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35185#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list