Ticket #14639 (new defect (bug))

Opened 22 months ago

Last modified 21 months ago

Posts in the Trash drag attachment pages down with them

Reported by: markel Owned by:
Priority: normal Milestone: Awaiting Review
Component: Media Version: 3.0.1
Severity: normal Keywords:
Cc: ryan@…, westi

Description

If you have an attachment linked to a post, then move the post to the Trash, the attachment page results in a 404.

Steps to reproduce:

  1. Create a new post with at least one image attached to it (just add it to the post).
  2. Publish the post.
  3. Check both the attachment URL (it will be a "child" of the post to which it is attached) and the post URL.
  4. Move the post to the Trash.
  5. Try to "View" the attachment either by going through the Media Library or by refreshing the attachment URL. WordPress will display a 404 message.

Deleting the post permanently can cause the attachment permalink to work again, both with the page parent in the slug and without that information in the form  http://sitename.com/attachmentname/ .

Change History

  • Cc ryan@… added
  • Cc westi added

Attachments inherit post status from the post they are attached too so they should behave as if they were no longer published which is what is happening here.

Why would you expect otherwise?

Point taken.

I'll argue then instead that the permalink should also result in a 404 when the post has been permanently deleted.

Note: See TracTickets for help on using tickets.