Make WordPress Core

Opened 8 years ago

Last modified 3 weeks ago

#44598 new defect (bug)

Main logo won't update when deleted and reuploaded with the same file name

Reported by: mimoho's profile mimoho Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Customize Keywords: dev-feedback close has-screenshots
Focuses: Cc:

Description

Hello,

I'm experiencing the following bug:
Adding a main gif logo in customizer by the media library and permanently deleting it, obviously does NOT permanently delete it but leaves some traces. When I change the color and/or the image format and reupload the slightly different file WITH THE SAME FILE NAME, WordPress displays the correct resolution in the attachment details along with the old thumbnail. Thus, although the image has been changed and rendered correctly, as I can see in the wp-content folder, the old image gets displayed on the page instead of the new main logo. Same for the cropping option before inserting. Refreshing the page doesn't help.

Regards

Change History (5)

#1 @SergeyBiryukov
8 years ago

  • Component changed from General to Customize

#3 @celloexpressions
5 years ago

  • Keywords needs-testing added

This sounds like either a caching issue or confusion stemming from the duplicated attachment posts created during the crop step. Can anyone reproduce the reported behavior ruling out those possibilities?

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


3 years ago

#5 @gaisma22
3 weeks ago

  • Keywords dev-feedback close has-screenshots added; needs-testing removed

Reproduction Report

Environment

  • WordPress: 7.0-beta3-61849-src
  • PHP: 8.3.30
  • Server: nginx/1.29.5
  • Database: MySQL 8.4.8
  • Browser: Brave
  • OS: Ubuntu
  • Theme: Twenty Twenty-One (twentytwentyone)
  • MU Plugins: None
  • Plugins: None (first test), Hello Dolly 1.7.2 (second test)

Steps taken

  1. Navigated to Appearance -> Customize -> Site Identity.
  2. Uploaded first logo (logo.gif - GIF image) via "Select logo". Skipped cropping.
  3. Confirmed logo displayed correctly in both Customizer preview and frontend at http://localhost:8889.
  4. Navigated to Media Library and permanently deleted the uploaded logo.
  5. Returned to Appearance -> Customize -> Site Identity.
  6. Clicked "Change logo" and uploaded second logo.gif (same filename, visually different GIF image). Skipped cropping.
  7. Clicked Publish in Customizer.
  8. Visited frontend at http://localhost:8889 and performed hard refresh (Ctrl+Shift+R).

Result: ❌ Bug is not occurring

Expected behavior

Based on the ticket description, after permanently deleting the first logo and reuploading a different image with the same filename, the old logo should still appear on the frontend instead of the new one, even after page refresh.

Additional Notes

  1. Tested first in a clean environment with no plugins active.
  2. Environment was reset and the test was repeated with Hello Dolly 1.7.2 active.
  3. In both tests, the new logo displayed correctly on the frontend immediately after publishing and hard refreshing.
  4. WordPress 7.0 handles same-filename logo replacement correctly with no caching issues observed.
  5. Removing needs-testing as the bug does not reproduce in WordPress 7.0-beta3-61849-src. Adding close - the issue appears fixed in a previous release.

Screenshots/Screencast with results

First logo:

https://i.ibb.co/VPXLzZd/04-second-logo-uploaded-customizer.png

https://i.ibb.co/wF7QpxVt/05-second-logo-frontend-no-bug.png

Second logo (with same filename):

https://i.ibb.co/KjK59jKF/01-first-logo-uploaded-customizer.png

https://i.ibb.co/tp73LrfD/02-first-logo-frontend.png

Note: See TracTickets for help on using tickets.