Opened 12 years ago
Closed 11 years ago
#22671 closed defect (bug) (wontfix)
Attachment pages 404 for media attached to an "Auto Draft"
Reported by: | miqrogroove | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.4.2 |
Component: | Media | Keywords: | has-patch |
Focuses: | Cc: |
Description
Any image uploaded to a new post through the post editor or QuickPress has a broken View link in the Media Library. To reproduce:
- Go to Dashboard.
- Upload an image in QuickPress.
- Go to Media Library.
- Click the View link for the image.
Expected result:
I thought it was going to show me the image or the image's attachment page.
Actual result:
"This is somewhat embarrassing, isn't it?" - 404 message from URL like /?attachment_id=112
This won't happen if the image is uploaded via the Upload New Media page.
Attachments (3)
Change History (18)
#2
in reply to:
↑ 1
;
follow-up:
↓ 3
@
12 years ago
Replying to ocean90:
The same happens, when you upload an image to a non-public post, like a pending post.
ocean90, I am unable to reproduce the behavior you're describing here. If I attach an image to a normal draft and save it, then the View link is not broken in Media Library.
#3
in reply to:
↑ 2
;
follow-up:
↓ 4
@
12 years ago
Replying to miqrogroove:
ocean90, I am unable to reproduce the behavior you're describing here. If I attach an image to a normal draft and save it, then the View link is not broken in Media Library.
I can reproduce the 404 message when I'm logged out.
#4
in reply to:
↑ 3
;
follow-up:
↓ 5
@
12 years ago
Replying to SergeyBiryukov:
I can reproduce the 404 message when I'm logged out.
If you're logged out, how are you seeing the Media Library?
#5
in reply to:
↑ 4
;
follow-up:
↓ 6
@
12 years ago
- Keywords close added
Replying to miqrogroove:
If you're logged out, how are you seeing the Media Library?
You can copy the attachment link and paste it to a private tab for example… It's just an example for how core does handle the post status of attachments. And that it's expected.
#6
in reply to:
↑ 5
@
12 years ago
Replying to ocean90:
You can copy the attachment link and paste it to a private tab for example… It's just an example for how core does handle the post status of attachments. And that it's expected.
Actually I don't see how that is relevant. I am getting broken links depending on which admin page I use to upload images. I am not copying links between browsers.
#7
follow-up:
↓ 8
@
12 years ago
Images attached to a post inherit the post's status. Images uploaded separately (and thus unattached) are simply published as-is. That's the relevance.
#8
in reply to:
↑ 7
@
12 years ago
Replying to nacin:
Images attached to a post inherit the post's status. Images uploaded separately (and thus unattached) are simply published as-is. That's the relevance.
Still confused here. Err... You are drawing an analogy between what is supposed to be publicly viewable vs. publicly inaccessible. While I don't disagree with that information, it is inconsistent with the bug I'm reporting. I think we need a matrix to explain this:
+------+----------+-----+----------+ |Viewer|Unattached|Draft|Auto-Draft| +------+----------+-----+----------+ |Admin | OK | OK | 404 | +------+----------+-----+----------+ |Public| OK | 404 | 404 | +------+----------+-----+----------+
Whether or not things are publicly viewable, they should not have broken links on the admin side.
#9
@
12 years ago
Also, in addition to the broken View link, after clicking the Edit link for one of these images a broken link gets added to the toolbar that says "View Attachment Page".
#10
@
12 years ago
The broken "View Attachment Page" link is new in 3.5. Do you need a separate ticket for that?
#11
follow-up:
↓ 12
@
12 years ago
Thinking through it a bit, it seems to me that there's a base issue of why attachments get attached to auto drafts that are no longer accessible to edit in the admin, except from the "Uploaded to" column on the media list table. We can hide the link, but that doesn't change the weirdness of having an "Auto Draft" post that doesn't show up in the posts list table.
#12
in reply to:
↑ 11
@
12 years ago
Replying to helenyhou:
We can hide the link, but that doesn't change the weirdness of having an "Auto Draft" post that doesn't show up in the posts list table.
Also, there's no way to attach auto-draft images to new posts. You can insert them, but if you link them to the Attachment Page those will be broken too.
#13
@
12 years ago
- Summary changed from Media View Links Are 404 to Attachment pages 404 for media attached to an "Auto Draft"
I think this is expected. When you upload an attachment it will be attached to the post. When nothing is changed it's an auto-draft. So the image will be attached to an auto-draft. Auto-drafts aren't public. The post status of an attachment is inherit, means it's non-public too.
The same happens, when you upload an image to a non-public post, like a pending post. A user which isn't logged in can't see the attachment too.
Related: #22556