Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 300130

Automatically configure source fields for new Media Types

$
0
0

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:

  1. 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.
  2. Source field configuration complicates the UX of creating new Media Types.
  3. 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.


Viewing all articles
Browse latest Browse all 300130

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>