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

slashrsm created an issue. See original summary.

slashrsm’s picture

joseph.olstad’s picture

Subscribing.
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.

joseph.olstad’s picture

Issue tags: +Needs backport to D7
joseph.olstad’s picture

Issue tags: -Needs backport to D7

I have created a D7 core patch for this, needs porting to D8

joseph.olstad’s picture

Issue summary: View changes