WordPress.org

Make WordPress Core

Opened 4 months ago

Last modified 3 months ago

#41411 new defect (bug)

REST API: Terms endpoint responses for PUT & POST requests don't set context to edit

Reported by: westonruter Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7
Component: REST API Keywords: has-patch needs-unit-tests
Focuses: Cc:

Description

The endpoints for posts, users, and comments all set the context to edit when returning the resource in the response for POST and PUT requests. The terms endpoint, however, unexpectedly returns the resource with the view context. In practice this won't cause a problem since all of the fields (in core) have both the view and edit contexts, but if a plugin adds additional fields that should only appear in the edit context then this could cause a problem where the unexpected fields would be returned in the response.

Attachments (1)

41411.0.diff (935 bytes) - added by westonruter 4 months ago.

Download all attachments as: .zip

Change History (3)

@westonruter
4 months ago

#1 @westonruter
4 months ago

  • Keywords has-patch added

#2 @rmccue
3 months ago

  • Keywords needs-unit-tests added

lgtm, we should add unit tests to check this though.

Note: See TracTickets for help on using tickets.