[wp-trac] [WordPress Trac] #48823: Collect all REST API meta errors at once

WordPress Trac noreply at wordpress.org
Thu Nov 28 03:35:44 UTC 2019


#48823: Collect all REST API meta errors at once
-------------------------------+-----------------------------
 Reporter:  TimothyBlynJacobs  |      Owner:  (none)
     Type:  enhancement        |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  REST API           |    Version:  4.7
 Severity:  normal             |   Keywords:
  Focuses:                     |
-------------------------------+-----------------------------
 Currently, when updating meta, we return immediately after encountering a
 `WP_Error`. If there are issues with multiple meta keys, you have to
 correct each value and send a new request one at a time. I think it'd be
 ideal if we could process all the meta fields and then return all the
 errors that are encountered at once.

 `WP_Error` supports multiple error messages with the same code, but it
 does not support multiple bits of `error_data` for the same code. This
 would be a problem for the errors that include the affected meta key in
 the error data. Right now, the REST API duplicates this data for each
 error with the same code ( `WP_REST_Server::error_to_response` ). I think
 we'd need to find a way to retain the error message and data correlation
 in `WP_Error`.

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


More information about the wp-trac mailing list