[wp-trac] [WordPress Trac] #35185: Unable to create Post via XMLRPC after upgrading to 4.4

WordPress Trac noreply at wordpress.org
Wed Dec 30 00:13:58 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 dossy):

 Replying to [comment:6 dd32]:
 > 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.

 I'd like to say that there is a semantic difference between a struct
 element not existing and not having any value, vs. it existing and its
 value is `null`, as well as its value being empty but not null.

 Unfortunately, the `nil` value is an XML-RPC extension, so I wouldn't
 expect to support it unless we intend to support that extension.  The
 standard convention is to represent `NULL` values as just that, a
 `<value>` element with no data, e.g. `<value/>` or `<value></value>` which
 is what @Sandeep.Prakash's `tcpdump` output shows is coming across.

 Not including those keys in the struct is different than being included in
 the struct but having a `NULL` value.  Being able to test for an
 `array_key_exists()` to test if it was included in the struct is useful
 and being able to test it for `is_null()` ...

 It's unfortunate that r35509 actually implements "better" support for XML-
 RPC, at the cost of breaking everything that sits behind it, which doesn't
 differentiate between struct members not existing vs. them having a `NULL`
 value.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35185#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list