[5.x]: Renaming an asset without the file extension fails with “” is not an allowed file extension.
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- PHP
- Estrellas
- 3.6k
- Forks
- 710
- Merge medio
- 11 h 29 min
- PR fusionados (30 d)
- 265
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de craftcms/cms
-
[5.x]: Passkeys registered with webauthn-lib v4 still fail with an uncaught InvalidUserHandleException (HTTP 500) after the #19530 fixPosiblemente ocupada @i-just la tomó hace 4 días. Abiertorepo:cms
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
craftcms/cms#20052 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[6.x]: Colored chips: link blue has low contrast on tinted backgroundsPosiblemente ocupada @brandonkelly la tomó hace 10 días. Abiertobug repo:cms
craftcms/cms#19984 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
bug repo:cms
Dificultad 3/5 1-2 días Aptitud para principiantes 62/100
craftcms/cms#19980 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
[6.x]: Text in some input fields is clipped at the bottom on WindowsPosiblemente ocupada @brianjhanson la tomó hace 16 días. Abiertobug repo:cms
craftcms/cms#19928 · 4 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
bug repo:cms
Dificultad 4/5 3-5 días Aptitud para principiantes 15/100
craftcms/cms#19916 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de craftcms/cms
Issues similares
-
Add TuneIn-DirMon in the bot listPosiblemente ocupada @liviuconcioiu la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
matomo-org/device-detector#8424 ·
Los mantenedores suelen responder en 1 día
-
affecting 5.2 only affecting 5.3 only bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
moodle-an-hochschulen/moodle-theme_boost_union#1463 ·
Los mantenedores suelen responder en 1 día
-
Course help wanted Sensei
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
woocommerce/woocommerce-paypal-payments#4838 ·
Los mantenedores suelen responder en 1 día
-
sync-en
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
Los mantenedores suelen responder en 2 días