[wp-trac] [WordPress Trac] #41604: REST API: Attempting to create or update a non-existent setting doesn't return an error response

WordPress Trac noreply at wordpress.org
Thu Aug 10 16:35:45 UTC 2017


#41604: REST API: Attempting to create or update a non-existent setting doesn't
return an error response
--------------------------------+-----------------------------
 Reporter:  johnbillion         |      Owner:
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Options, Meta APIs  |    Version:
 Severity:  normal              |   Keywords:  needs-patch
  Focuses:  rest-api            |
--------------------------------+-----------------------------
 Attempting to create a new setting via a POST request to `/wp/v2/settings`
 returns a 200 response, despite the request having been invalid. The same
 goes for attempting to update a non-existent setting with a PUT request.

 I would have expected maybe a 400 from such requests.

 The internal logic in `WP_REST_Settings_Controller` routes the request
 through the `update_item()` method, treats it as a setting update, and
 silently ignores the problem.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41604>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list