#23013
closed
defect (bug)
(duplicate)
Gallery images don't display when original post associated with image is trashed
Reported by:
[Image: nmoinvaz's profile]
nmoinvaz
Owned by:
Milestone:
Priority:
normal
Severity:
normal
Version:
3.5
Component:
Gallery
Keywords:
Focuses:
Cc:
Description
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.
Repo steps:
- Create post A
- Upload image X
- Create gallery in post A with image X
- Save post A as a draft
- Create post B
- Create gallery in post B with image X
- Delete post A
- View post B
- 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.
Change History
(3)
#1
@nmoinvaz
11 years ago
I am able to get around it temporarily by changing
if ( !empty($this->posts) && ($this->is_single || $this->is_page)) {
to:
if ( !empty($this->posts) && (($this->is_single && !$this->is_attachment) || $this->is_page))
In query.php.
#2
@helen
11 years ago
-
Milestone
Awaiting Review deleted
-
Resolution
set to duplicate
-
Status
changed from new to closed
It's hard to tell because it only shows briefly in the screencast, but it looks like by full size image you mean the attachment page, in which case this is a duplicate of
#14639
#3
@nmoinvaz
11 years ago
You are correct. This would be the same issue. Thanks for pointing me in the right direction.