Problem/Motivation
Currently, when you create a new Media Type, you're prompted to either create a new source field or use an existing one. The logic for creating a source field only lives in the form, and once the source field is added it can never change or be deleted.
This has a few problems:
- Creating new Media Types programmatically is difficult as you have to create the Media Type entity and a new field, then configure the Media Type to use this field.
- Source field configuration complicates the UX of creating new Media Types.
- Source fields are prefixed with field_, but are treated like base fields both in code and in various user interfaces.
Proposed resolution
Use base fields instead of user-configurable fields for Media sources, remove all UI stuff around configuring source fields or preventing their deletion.
This can be accomplished by implementing hook_entity_bundle_field_info
and hook_entity_field_storage_info
, I think, and calling "createSourceField()" on the media source plugin to determine the field definition and storage definition.
Remaining tasks
Look into this - This hasn't been tried yet, so it might not even work!
User interface changes
Undecided.
API changes
Undecided.
Data model changes
Undecided.