Opened 3 years ago
Closed 3 years ago
#54015 closed defect (bug) (fixed)
Unable to pass _embed param to enveloped REST API requests
Reported by: | spacedmonkey | Owned by: | spacedmonkey |
---|---|---|---|
Milestone: | 6.0 | Priority: | normal |
Severity: | normal | Version: | 5.4 |
Component: | REST API | Keywords: | has-patch has-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 (17)
This ticket was mentioned in PR #1619 on WordPress/wordpress-develop by spacedmonkey.
3 years ago
#1
This ticket was mentioned in PR #1619 on WordPress/wordpress-develop by spacedmonkey.
3 years ago
#2
Trac ticket: https://core.trac.wordpress.org/ticket/54015
#3
@
3 years 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:
↓ 7
@
3 years ago
- Keywords needs-unit-tests added
- Milestone changed from Awaiting Review to Future Release
Can we get a test for this?
This ticket was mentioned in Slack in #core-restapi by spacedmonkey. View the logs.
3 years ago
#7
in reply to:
↑ 4
@
3 years 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
@
3 years ago
I'm not surprised to be honest, I remember this from another ticket that touched the _embed
parameter.
@TimothyBlynJacobs Thoughts?
#9
@
3 years 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.
#10
@
3 years ago
@TimothyBlynJacobs I am not sure what you mean there. Any chance you could put together a test for this or point in the direction of one.
#11
@
3 years ago
Something along the lines of this:
$this->expectOutputString( 'json body that we expect' );
$_GET['embed'] = 'link';
rest_get_server()->serve_request('/endpoint/to/test');
This ticket was mentioned in PR #2544 on WordPress/wordpress-develop by spacedmonkey.
3 years ago
#12
- Keywords has-unit-tests added; needs-unit-tests removed
Trac ticket: https://core.trac.wordpress.org/ticket/54015
This ticket was mentioned in Slack in #core-restapi by spacedmonkey. View the logs.
3 years ago
TimothyBJacobs commented on PR #2544:
3 years ago
#15
LGTM! Just some minor bits of feedback.
Trac ticket: https://core.trac.wordpress.org/ticket/54015