File and image widgets are misleading about the extensions they accept

Created on 6 April 2017, over 7 years ago
Updated 15 July 2024, 3 months ago

I have found a sadness in the file and image widgets' UI:

If you have a file or image field, you can set the allowed file extensions when editing the field settings. But if you use an core upload widget with that same field, you will see that it will not necessarily accept all of the configured extensions. To feel this sadness for yourself, try adding 'svg' as an accepted extension on an image field. You will still not be able to upload SVGs.

Acceptable file extensions are understandably limited for security purposes, but this is really bad UX. If I tell Drupal to accept SVGs, and it flatly refuses, it looks like a bug. We need to fix the UI to make it clear that the file types accepted by the field are not necessarily going to be accepted by the widget.

Proposed Resolution

Two things:

1) Alter the description of the "Allowed file extensions" field (on the field settings form for file and image fields) to mention that widgets may restrict the list of allowed file types.

2) When configuring the widget ("Manage form display"), the file types accepted by the widget should be listed.

API Changes

None.

UI Changes

More clarity, less confusion.

πŸ› Bug report
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component
File moduleΒ  β†’

Last updated 16 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¦πŸ‡ΊAustralia kim.pepper πŸ„β€β™‚οΈπŸ‡¦πŸ‡ΊSydney, Australia

    The list of allowed extensions comes directory from the extension validator. Can we confirm this bug still exists?

Production build 0.71.5 2024