The problem:

  1. I have file fields using the Media Browser widget, set to allow the 'Document' file type only.
  2. I edit my Document file type to add support for xml (text/xml) files.
  3. I have to now go through all my file fields and edit the 'Allowed file extensions for uploaded files' field to add 'xml' as an allowed extension, even though I've said I only allow the Document file type. I think this is redundant and a blow to usability.

This is a similar issue to #2533326: Should the list of allowed extensions on file/add be generated from all the current file types?. For people using the Media widget for file and image fields, since we already provide an allowed file type selection, I think we should generate the list of allowed extensions based on those file types, and hide/ignore the 'Allowed extensions' field in the configuration. Or we could only show the 'Allowed extensions' textfield if the user hasn't limited the file types at all. In that case, the field should be visible, but not optional to override the allowed extensions.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TwoD’s picture

Status: Active » Needs review
FileSize
852 bytes

Here's a really simple way to approach this, while leaving per-field flexibility in there.
It simply makes the File field's file_extensions setting optional when using the Media Browser widget.
If file_extensions is left empty, File Entity module takes over and generates the list based on the selected file types (or all if none have been selected).

  • joseph.olstad committed c90a7fc on 7.x-2.x authored by TwoD
    Issue #2533352 by TwoD: Rethink allowed extensions on field instance
    
joseph.olstad’s picture

Status: Needs review » Fixed

committed to 7.x-2.x dev

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.