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.

CommentFileSizeAuthor
#6 svg.png15.5 KBbander2
#2 2867494-2.patch3.21 KBphenaproxima

Comments

phenaproxima created an issue. See original summary.

phenaproxima’s picture

Status: Active » Needs review
Issue tags: +Needs tests
StatusFileSize
new3.21 KB
phenaproxima’s picture

Issue summary: View changes
bander2’s picture

Status: Needs review » Needs work

svg is showing up on the form display for an image field configured to accept them. Shouldn't that be removed since the widget won't accept them?

phenaproxima’s picture

@bander2, I'm not sure I understand what you mean. Screenshots would be helpful here, if possible.

bander2’s picture

StatusFileSize
new15.5 KB

svg

I was not expecting "svg" to be listed since the premise of the issue is that a svg is not allowed on an image field even if the field is configured to accept them. I thought the fix would list the allowed extensions trimmed to those allowed by the widget.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

kim.pepper’s picture

Status: Needs work » Postponed (maintainer needs more info)

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

smustgrave’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)
Issue tags: +Bug Smash Initiative

Since there's been no follow up to #19 or movement really since 2017. Going to close out but if still an issue in D11 please re-open