[wp-trac] [WordPress Trac] #38989: Invalid meta causes warning in WP_Test_REST_Post_Meta_Fields

WordPress Trac noreply at wordpress.org
Thu Dec 1 17:54:51 UTC 2016


#38989: Invalid meta causes warning in WP_Test_REST_Post_Meta_Fields
-------------------------------------------------+-------------------------
 Reporter:  timmydcrawford                       |       Owner:
     Type:  defect (bug)                         |  rachelbaker
 Priority:  normal                               |      Status:  assigned
Component:  REST API                             |   Milestone:  4.7
 Severity:  normal                               |     Version:  trunk
 Keywords:  has-patch has-unit-tests needs-      |  Resolution:
  refresh                                        |     Focuses:
-------------------------------------------------+-------------------------
Changes (by rachelbaker):

 * keywords:  has-patch has-unit-tests => has-patch has-unit-tests needs-
     refresh


Comment:

 Our schema ignores the sanitization or validation callbacks in top-level
 parameters (like the `meta` object parameter).  After discussing with
 @joehoyle in person, we agree that special-casing `meta` as proposed in
 [attachment:38989.2.diff]  is a hacky workaround the real problem.

 Instead, we decided for 4.7 we would ignore the `meta` property in a
 request if it is not an array, which is better than returning a PHP
 Warning which results in unparsable JSON data.  Updated patch incoming...

 For 4.8 @joehoyle wants to fix this in `register_rest_field`.  @joehoyle
 would you mind creating a ticket for the underlying problem for solving in
 4.8?

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


More information about the wp-trac mailing list