Make WordPress Core

Opened 6 years ago

Closed 7 months ago

#40174 closed defect (bug) (wontfix)

Found a bug in uploading image

Reported by: sanjaypopli3749's profile sanjaypopli3749 Owned by:
Milestone: Priority: normal
Severity: minor Version: 4.6.1
Component: Media Keywords: reporter-feedback
Focuses: Cc:

Description

Hi

I found a bug while uploading image through media section. I uploaded an image and deleted that permanently. I uploading another image with exactly same name and image was uploaded successfully but i was not able to see new image. It was showing old thumbnail and old image in popup when i clicked that. One thing was good that when i clicked Edit button, it was showing new image.

Not sure this bug is removed in later versions of wordpress, if no then please look into this.

Thanks
Sanjay

Change History (6)

#1 @jnylen0
6 years ago

My guess is that your browser was caching the old thumbnail. Can you try again, but clear your browser cache after uploading the new image?

#2 @swissspidy
6 years ago

Also, in any case, please try to see if it works in the latest version of WordPress'

Thanks!

#3 @SergeyBiryukov
6 years ago

  • Keywords reporter-feedback added

#4 @skorasaurus
4 years ago

  • Severity changed from normal to minor

Honestly, I was expecting to suggest closing this, but I was able to reproduce this, only in very specific circumstances:

This is on WordPress 5.1.

  1. upload media (I did this through wp media import filename.jpg)
  2. Delete the original photo from the file system (within uploads/) (if your photo is named filename.jpg; only delete filename.jpg; do not delete the resized images).
  3. upload media different media with same filename as step 1 (wp media import filename.jpg)
  4. Go to the media manager (sorry if this is the wrong term) (the url is wp-admin/upload.php); the original photo is still listed there.
  5. Click on the original photo's thumbnail to open 'attachment details' modal.

The original photo's thumbnail and the larger image are still present.

  1. Click "edit photo" at the bottom of the modal; the newly renamed image will then appear even though the url is for the first item's attachment ID (in my case, it was wp-admin/upload.php?item=20&mode=edit

If you delete the original photo through "Delete permanently" in the "attachment details" modal as is the recommended practice, the original photo does not appear in the media manager.

I did not try to reproduce this by uploading the photo through wp-admin/upload.php

Last edited 4 years ago by skorasaurus (previous) (diff)

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


7 months ago

#6 @antpb
7 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

This ticket was discussed in the recent Media component meeting and it was agreed that this behavior requires some non-standard ways of deleting media. Because a media item is essentially a post, it stands to reason that the post will persist in the media library if one of the image's sizes are deleted manually from the filesystem. This bypasses all core logic creating a broken state manually.

As such, this sort of logic I think would be best fit in a sort of image regeneration plugin that cleans up any images that have lost their original attachment image by manual deletion.

Note: See TracTickets for help on using tickets.