Opened 13 years ago
Closed 13 years ago
#23719 closed defect (bug) (fixed)
Twenty Thirteen: Attachment URLs for unattached images cause redirect loop
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 3.6 | Priority: | normal |
| Severity: | major | Version: | 3.6 |
| Component: | Bundled Theme | Keywords: | has-patch close |
| Focuses: | Cc: |
Description (last modified by )
In Twenty Thirteen, the attachment url for an unattached image (e.g. http://local.dev/trunk/?attachment_id=5252#main) results in an infinite redirect loop.
See #23543 for original improvements.
Attachment urls for attached images (e.g. http://local.dev/trunk/sample-page/hd-traver-4/#main) are fine.
Commenting out add_filter( 'attachment_link', 'twentythirteen_attachment_link' ); in functions.php is the quick fix.
Attachments (2)
Change History (13)
#2
follow-up:
↓ 4
@
13 years ago
- Milestone changed from Awaiting Review to 3.6
trepmal, do you want to prepare a patch that uses _s' approach?
#4
in reply to:
↑ 2
;
follow-up:
↓ 5
@
13 years ago
Replying to obenland:
trepmal, do you want to prepare a patch that uses _s' approach?
Why does the attachment have to be an image? If I upload a PDF file, I might still want to link to the parent, right?
#5
in reply to:
↑ 4
@
13 years ago
- Keywords has-patch added; needs-patch removed
Replying to lancewillett:
Why does the attachment have to be an image? If I upload a PDF file, I might still want to link to the parent, right?
The purpose of twentythirteen_attachment_link() is to reposition the screen on load so the user does not have to scroll down to have a comfortable view of the image. I don't think we need to do that for other attachement types since the vast majority of them will be links to a file.
#6
follow-up:
↓ 7
@
13 years ago
I think this is a situation where a theme is trying to be far too clever. I'd maybe let it slide in another theme but not in a default theme that should be setting an example of simple. -100 to twentythirteen_attachment_link().
#7
in reply to:
↑ 6
@
13 years ago
Replying to nacin:
I think this is a situation where a theme is trying to be far too clever. I'd maybe let it slide in another theme but not in a default theme that should be setting an example of simple. -100 to twentythirteen_attachment_link().
So you are voting for simpler code in functions.php over a better user experience? I'm leaning your way, but want to be clear on the trade-offs.
Attached patch resolves the issue for me, but I'm not too familiar with all the canonical stuff, so not sure what sort of side-effects there might be.