Opened 4 years ago
Last modified 2 months ago
#48823 assigned enhancement
Collect all REST API meta errors at once
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 6.5 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | REST API | Keywords: | has-patch has-unit-tests needs-testing-info |
Focuses: | Cc: |
Description
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
.
Change History (20)
This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.
3 years ago
#3
@
3 years ago
- Keywords needs-patch added
Per Timothy in today's core scrub:
Needs patch probably. Planning on working on it this week
This ticket was mentioned in PR #877 on WordPress/wordpress-develop by TimothyBJacobs.
3 years ago
#4
- Keywords has-patch has-unit-tests added; needs-patch removed
Trac ticket: https://core.trac.wordpress.org/ticket/48823
This ticket was mentioned in Slack in #core-restapi by hellofromtonya. View the logs.
3 years ago
#6
@
3 years ago
Per Timothy, this ticket is blocked by #46191.
This ticket was mentioned in Slack in #core by chaion07. View the logs.
3 years ago
#9
@
3 years ago
- Milestone changed from 5.8 to Future Release
This one has not seen any activity during the 5.8 cycle. I'm going to punt to Future Release
to prevent repeated punting. But it can be moved back to a numbered milestone at any time.
#10
@
9 months ago
This change looks good @TimothyBlynJacobs . I think we can get this in the next release.
This ticket was mentioned in Slack in #core-restapi by spacedmonkey. View the logs.
5 months ago
#12
@
5 months ago
- Milestone changed from Future Release to 6.4
- Owner set to spacedmonkey
- Status changed from new to assigned
#13
@
4 months ago
The patch is still applicable, no rebase is needed. @TimothyBlynJacobs and @spacedmonkey what is the next step, testing? If so, we need testing info.
This ticket was mentioned in Slack in #core-restapi by spacedmonkey. View the logs.
2 months ago
This ticket was mentioned in Slack in #core by oglekler. View the logs.
2 months ago
#18
@
2 months ago
In discussing with @azaozz, we both have concerns of potential regressions and/or unexpected behaviors due to the code not bailing out immediately with an error, i.e. being allowed to continue processing.
Given how important the REST API is, we're thinking this one is a good early
candidate. Rather than committing it right before 6.4 Beta 1, instead commit it when 6.5 Alpha opens.
early
would give it a long soak time to potentially discover if there are indeed regressions or unexpected behaviors. For example, the Gutenberg plugin uses the REST API. It's a good candidate to flush out if there are any unknown issues.
@azaozz noted:
Yea, thinking it may be a bit risky, and testing it and confirming it doesn't bring a regression would be great
@TimothyBlynJacobs @spacedmonkey what do you both think? Are there risks?
Going to try taking a look at this for 5.7 now that we can merge
WP_Error
objects and keep additional data.