[wp-trac] [WordPress Trac] #23013: Gallery images don't display when original post associated with image is trashed

WordPress Trac noreply at wordpress.org
Thu Dec 20 03:41:49 UTC 2012


#23013: Gallery images don't display when original post associated with image is
trashed
-----------------------------+--------------------------
 Reporter:  nmoinvaz         |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Gallery
  Version:  3.5              |   Severity:  normal
 Keywords:                   |
-----------------------------+--------------------------
 I've looked through a bunch of tickets so forgive me if this is a
 duplicate but I couldn't find anything like it on here.

 The problem I believe is that you can assign 1 image to different
 galleries in different posts. If you delete the original post on which the
 image was first attached, then the other posts with galleries that are
 associated with that image will no longer display the full-sized image.

 I have attached a video screencast showing the problem on one of our test
 sites.

 http://screencast.com/t/Xtft68eeeD

 Repo steps:

 1. Create post A
 2. Upload image X
 3. Create gallery in post A with image X
 4. Save post A as a draft
 5. Create post B
 6. Create gallery in post B with image X
 7. Delete post A
 8. View post B
 9. Click on image X and view full-sized image

 I tracked down the issue query.php around ~ line 2700 where it does a
 check to see if the the attachment is public/trashed. When viewing post B
 it instantly gets the attachment's post_parent which is now trashed.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23013>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list