If I create an entity reference field (not file field) that can reference files, I cannot use any file field formatters to output the referenced files. Similar situation for image field formatters. Or for using entity reference field formatters on file and image fields.
Contributed modules like https://www.drupal.org/project/file_image_formatters and https://www.drupal.org/project/file_entity_reference_image_formatter and https://www.drupal.org/project/entity_formatters. This is easily solvable from core.
Allow reuse between file, image, and entity_reference field formatters.
If a field extends another field, it should ensure that the parent field's formatters are available to it as well. And in the case of entity-specific reference fields that extend the entity_reference field type, the entity-specific formatter should be available to entity_reference if the target_type matches the specific entity type.
- Write tests
- Needs change notice
User interface changes
- None (aside from additional formatters available in Field UI).
Data model changes