WordPress.org

Make WordPress Core

Opened 5 months ago

Last modified 3 months ago

#54015 assigned defect (bug)

Unable to pass _embed param to enveloped REST API requests

Reported by: spacedmonkey Owned by: spacedmonkey
Milestone: Future Release Priority: normal
Severity: normal Version: 5.4
Component: REST API Keywords: has-patch needs-unit-tests
Focuses: rest-api Cc:

Description

Added in #39696, developers can now selectively embed links. However this value is not passed down the enveloped requests.

Change History (9)

#3 @spacedmonkey
5 months ago

  • Summary changed from Unable to pass _embed param to enveloped requested to Unable to pass _embed param to enveloped REST API requests

#4 follow-up: @johnbillion
5 months ago

  • Keywords needs-unit-tests added
  • Milestone changed from Awaiting Review to Future Release

Can we get a test for this?

#5 @spacedmonkey
5 months ago

  • Owner set to spacedmonkey
  • Status changed from new to assigned

This ticket was mentioned in Slack in #core-restapi by spacedmonkey. View the logs.


3 months ago

#7 in reply to: ↑ 4 @spacedmonkey
3 months ago

Replying to johnbillion:

Can we get a test for this?

I had a look into this and is not easy to add a test here. Lots have to be mocked this change is deeply embed in the serve_request method. I was thinking about somehow exacting the logic, to make easier to test. Thoughts @johnbillion ?

#8 @johnbillion
3 months ago

I'm not surprised to be honest, I remember this from another ticket that touched the _embed parameter.

@TimothyBlynJacobs Thoughts?

#9 @TimothyBlynJacobs
3 months ago

I think we should be able to use expectOutputString and call serve_request after setting $_GET['embed'] to the value we want to test.

Note: See TracTickets for help on using tickets.