[wp-trac] [WordPress Trac] #50786: REST API: delete post from block editor triggers a warning
WordPress Trac
noreply at wordpress.org
Mon Jul 27 15:52:14 UTC 2020
#50786: REST API: delete post from block editor triggers a warning
--------------------------+--------------------------------
Reporter: manooweb | Owner: TimothyBlynJacobs
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 5.5
Component: REST API | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+--------------------------------
Comment (by TimothyBlynJacobs):
I think I figured this out, it looks like this happens because the delete
request is sent with an `application/json` content type header but an
empty body. This causes `WP_REST_Request::parse_json_params()` to bail out
early before setting the `JSON` parameter. It seems odd to me that we
don't default `JSON` to an empty array if it is a JSON request considering
we do do that for the other parameter types, but I think making that
change would be too large to do at this point.
I'm adding a patch that will add safety checks in `set_param()`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50786#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list