[wp-trac] [WordPress Trac] #44750: #44287 caused attachment link attributes to be lost
WordPress Trac
noreply at wordpress.org
Tue Aug 7 14:56:01 UTC 2018
#44750: #44287 caused attachment link attributes to be lost
-------------------------------+--------------------------------------
Reporter: TimothyBlynJacobs | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 4.9.8
Severity: major | Keywords: has-patch has-unit-tests
Focuses: rest-api |
-------------------------------+--------------------------------------
#44287 changed the attachments controller to use the links generated from
the original response by the posts controller. However, the `add_links()`
method used has a different format than `get_links()` returned causing the
original attributes to be nested under an “attributes” key instead of
being inline with the `href` attribute.
I’ve attached a patch to fix this that adds tests to check the attributes
for the links as well, not just that the relations exist.
Reported by @soean in Slack,
https://wordpress.slack.com/archives/C02RQC26G/p1533552138000130.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44750>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list