Problem/Motivation
We add fields that handle alt and title attributes on the image. Core, on the other hand, stores values for those attributes on an image field. This causes some inconsistencies. If an image is rendered through entity view display we use alt/title from the fields and ignore any values that might be available on the field. When using core's image formatter the problem is reversed; fields on the entity are ignored and values from the field are used.
It would be great to figure out how to make this consistent. How do we sync alt/title between image field and file entity? What happens if data was changed on both sides after sync? Should we override core's image field formatter and widget to pass responsibility for alt/title to the file entity? This is certainly possible, but becomes problematic if another module overrides the same plugin.
Proposed resolution
Fix core, as seen in
#2835135: image formatter needs to handle alt/title from file entities on images for multi language support
Comments
Comment #2
slashrsm commentedComment #3
joseph.olstadSubscribing.
We need this fix for D7 Media as well. So from what I understand of the issue description it appears that core's image formatter is not handling file entities as we'd expect. While file entity is not in D7 core, a fix in core will be required , a condition on module_exists for file_entity would make it backwards compatible with D7 configurations that are not using file_entity.
Comment #4
joseph.olstadComment #5
joseph.olstadI have created a D7 core patch for this, needs porting to D8
Comment #6
joseph.olstadPlease see the D7 core patch for this here:
#2835135: image formatter needs to handle alt/title from file entities on images for multi language support
D8 core patch to follow.
Comment #7
joseph.olstad