Opened 5 weeks ago
Last modified 5 weeks ago
#65161 new defect (bug)
Give an error message when a non-image is uploaded for site icon
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Media | Keywords: | has-patch |
| Focuses: | Cc: |
Description
Just like #39625, when you are on General Settings to Choose a Site Icon, then choose Upload files and select a non-image file, you'll get to a ugly looking page showing a non helping error message. See attached video.
Attachments (1)
Change History (6)
#2
@
5 weeks ago
I was able to identify that this issue extends to "Customizer -> Site Identity -> Select Logo" selection and "Customizer -> Header Media -> Add Header Image" selection as well apart from Select Site Icon in General Settings, Customizer.
I am working on a fix for the same.
This ticket was mentioned in PR #11713 on WordPress/wordpress-develop by @intenzi.
5 weeks ago
#3
- Keywords has-patch added
Trac ticket: https://core.trac.wordpress.org/ticket/65161
## PR Description
- Added window alert popup for the Site Icon, Logo and Header Image selections.
Output Video:
## Use of AI Tools
AI assistance: Yes
Tool: Antigravity
Model(s): Gemini 3.5 Pro, Gemini 3 Flash
Used for: Pinpointing the relevant files in the codebase for adding the fix. Final implementation was reviewed by me.
#5
@
5 weeks ago
Thankyou, I went with window.alert() as the media selection modal overlays on top and thus existing notification systems like the wp.Customize.notification one would get hidden if utilised. This appears to be the correct way to display the error message to the user. Always open to any suggestions if you know of a way it can be improved!
If someone uploads a text file (or other non-image) for a site icon and selects it, then the 'Crop image' dialog shows the
<img>alternative text:The button text remains the same as it was in the Upload part of the dialog, and clicking the button has no effect.
Interestingly, if I resize the window height while the dialog is on the 'Crop image' step, the button text switches to "Crop image" and clicking that triggers an error message.