[wp-trac] [WordPress Trac] #40838: REST API: Inconsistent parameter type handling in `set_param()`

WordPress Trac noreply at wordpress.org
Fri Nov 29 02:47:26 UTC 2019


#40838: REST API: Inconsistent parameter type handling in `set_param()`
-------------------------------------------------+-------------------------
 Reporter:  jnylen0                              |       Owner:  vagios
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  REST API                             |     Version:  4.4
 Severity:  minor                                |  Resolution:
 Keywords:  good-first-bug needs-unit-tests      |     Focuses:  rest-api
  needs-patch                                    |
-------------------------------------------------+-------------------------
Changes (by TimothyBlynJacobs):

 * keywords:  good-first-bug has-unit-tests has-patch => good-first-bug
     needs-unit-tests needs-patch


Comment:

 Apologies @vagios for letting this slip away.

 Looking at the patch again, I think we'd want to stop after updating the
 parameter for the first parameter type instead of overwriting it for all
 types. That way we retain as much of the original semantics of the request
 as possible.

 I also wonder if we need to skip checking the `defaults` parameter type. I
 don't think we should override the default values if someone calls
 `set_param()` with a parameter that was initially provided in the request.
 In that case, I think we'd fall back to the first parameter type in the
 order.

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


More information about the wp-trac mailing list