#33693 closed defect (bug) (fixed)
Feed links are broken for unattached attachments
Reported by: | swissspidy | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Feeds | Keywords: | needs-patch good-first-bug |
Focuses: | Cc: |
Description
As per #33664, a media item that isn't attached to a post has a permalink of the form http://example.org/?attachment_id=123
.
When you visit that page, you'll notice that the comments feed links for this attachment posts are wrong, looking something like this: http://example.org/?attachment_id=123/feed/
.
This is because get_post_comments_feed_link()
just appends /feed/
to the permalink if pretty permalinks are enabled. It should check for this scenario though.
Attachments (1)
Change History (9)
#2
@
9 years ago
I'm also experiencing a redirect loop when trying to visit the comment feed link for a unattached attachment when pretty permalinks are disabled.
#3
@
9 years ago
Here is a patch - I added a check wp_get_post_parent_id and made a exception in feed url for unattached attachments.
#4
@
9 years ago
- Milestone changed from Awaiting Review to 4.4
- Owner set to wonderboymusic
- Status changed from new to assigned
#6
@
9 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Test Tests_Link_GetPostCommentsFeedLink::test_attachment_no_name_pretty_link
via r34336 is fails multisite tests
4) Tests_Link_GetPostCommentsFeedLink::test_attachment_no_name_pretty_link Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'http://example.org/?feed=rss2&p=1149' +'http://example.org/2015/09/19/post-title-1/attachment/1149/feed/' /home/travis/build/aaronjorbin/develop.wordpress/tests/phpunit/tests/link/getPostCommentsFeedLink.php:106
Note: The test passes if run as only part of the link
group phpunit --group link -c tests/phpunit/multisite.xml
but fails when run with the complete multisite tests phpunit -c tests/phpunit/multisite.xml
See also #1914. Either we wait for the permalinks to be changed or fix this separately.