[5.x]: Renaming an asset without the file extension fails with “” is not an allowed file extension.
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Start at the asset edit flow that saves the Filename field and trace how it validates extensions, especially names with no extension or a dot in the base name. Add or locate tests for renaming Test.pdf to Test-Renamed and Test-Schedule-v1.2; done means the original extension is retained or the validation error clearly reports a missing or disallowed extension.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened?
On the asset edit page, the Filename field contains the full filename, including the extension (e.g. Activities-Schedule.pdf). When editors rename a file, they often type just the new name and leave out the extension, since that's what they'd expect to edit.
Craft then rejects the save, and the error shows an empty extension: “” is not an allowed file extension. The Filename field also goes back to the original name, so it isn't clear to editors what went wrong or how to fix it. Our content editors have reported this as a bug.
The same thing happens when the new name contains a dot, such as a version number (Schedule-v1.2). Craft reads 2 as the extension and rejects it.
It would help if Craft kept the original extension when the new filename has none, or showed the extension as a fixed suffix outside the editable part of the field.
Steps to reproduce
- Upload a PDF to any asset volume, e.g. Test.pdf.
- Open the asset's edit page in the Control Panel.
- In the Filename field, replace the whole value with Test-Renamed (no extension).
- Click Save.
Expected behavior
The asset is renamed to Test-Renamed.pdf, keeping the original extension. Or, at minimum, the error says that the file extension is missing.
Actual behavior
The save fails with "Couldn’t save asset." and the field error “” is not an allowed file extension., and the Filename field goes back to Test.pdf.
Renaming to Test-Schedule-v1.2 fails the same way with “2” is not an allowed file extension.
Craft CMS version
5.11.3 (Pro)
PHP version
8.2.30
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
- Lingua principale
- PHP
- Stelle
- 3.6k
- Fork
- 706
- Merge medio
- 11h 2m
- PR unite (30g)
- 252
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di craftcms/cms
-
[6.x]: Text in some input fields is clipped at the bottom on WindowsForse già presa @brianjhanson l’ha presa 4 giorni fa. Apertabug repo:cms
craftcms/cms#19928 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
bug repo:cms
Difficoltà 4/5 3-5 giorni Idoneità per principianti 15/100
craftcms/cms#19916 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[6.x]: AdminTable not available for plugin index and settings screensForse già presa @brianjhanson l’ha presa 5 giorni fa. Apertabug repo:cms
craftcms/cms#19912 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[6.x]: No way for custom element types to add top level buttons in toolbar or beside the Save menuForse già presa @brianjhanson l’ha presa 5 giorni fa. Apertabug repo:cms
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
craftcms/cms#19910 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[6.x] Licence nag countdown never continues to the control panel, and there's no button to skip itForse già presa @brandonkelly l’ha presa 6 giorni fa. Apertabug repo:cms
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
craftcms/cms#19895 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di craftcms/cms
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 60/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ProfessionalWiki/NeoWiki#1675 ·
I maintainer di solito rispondono entro 1 giorno
-
Incorrect documentationAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
WhatsApp link preview crawler is not detected as a botForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
matomo-org/device-detector#8405 ·
I maintainer di solito rispondono entro 1 giorno