Problem/Motivation
This is a follow-up for #2894270: Users unable to add an extension to the file upload field.
Quoting @seanB's excellent comment at #2894270-4: Users unable to add an extension to the file upload field:
- Creating a source field for a default media type in a module.
This is already possible by providing default config when installing the module.- Auto creating a source field when manually creating a Media type
This is already possible by implementingcreateSourceField()in the MediaSource plugin.- Reusing an existing source field for a manually created media type
This allows all fields of a type (for example all entity reference fields in the case of Brightcove). This should be solved.- Changing a source field after it is created
In some cases, for instance Brightcove, some settings of the source field should not be changed. This should be solved.So to sum it up, I think these are the actual things to fix.
- Remove locking source fields since this prevents us from changing certain settings that should be available (most settings for most fields are no problem to change).
- Make sure users can only select source fields that make sense for the media type. Filtering by field type is not enough.
- Make sure some field settings or field storage settings can not be changed after the field is created. The media source should be able to lock certain settings somehow.
Background information/related issues/history
There already several issues on this subject (some very old — see #806102-34: Locked fields can change the widget but not settings for some git archeology that shows this problem was likely introduced when CCK was added to Drupal core in 2009):
field system: #806102: Locked fields can change the widget but not settingsfield_ui.module: #2274433: Do not allow to alter Locked field via UIconfiguration entity system: #2289551: Clarify what 'locked' means for a config entity and whether it's okay for code to rely on a locked config entity existingmedia system: #2894271: Users unable to change a media source file/image from public to private
The first 3 are generic/systemic problems. Solving them would likely also solve the problems that Media has, or go a long way.
Proposed resolution
TBD
Remaining tasks
Investigate how the 3 long-standing issues (#806102 + #2274433 + #2289551) would or would not solve the problems Media has.
User interface changes
TBD
API changes
TBD
Data model changes
TBD
Comments