Opened 5 years ago
Closed 4 years ago
#54015 closed defect (bug) (fixed)
Unable to pass _embed param to enveloped REST API requests
| Reported by: | spacedmonkey | Owned by: | spacedmonkey |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.0 |
| Component: | REST API | Version: | 5.4 |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: | rest-api |
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.
5 years ago
#1
This ticket was mentioned in PR #1619 on WordPress/wordpress-develop by spacedmonkey.
5 years ago
#2
Trac ticket: https://core.trac.wordpress.org/ticket/54015
#3
@
5 years ago
- Summary Unable to pass _embed param to enveloped requested → Unable to pass _embed param to enveloped REST API requests
#4
follow-up:
↓ 7
@
5 years ago
- Keywords needs-unit-tests added
- Milestone Awaiting Review → Future Release
Can we get a test for this?
This ticket was mentioned in Slack in #core-restapi by spacedmonkey. View the logs.
5 years ago
#7
in reply to: ↑ 4
@
5 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
@
5 years ago
I'm not surprised to be honest, I remember this from another ticket that touched the _embed parameter.
@TimothyBlynJacobs Thoughts?
#9
@
5 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
@
4 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
@
4 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.
4 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.
4 years ago
TimothyBJacobs commented on PR #2544:
4 years ago
#15
LGTM! Just some minor bits of feedback.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://core.trac.wordpress.org/ticket/54015