The problem is that file_entity_field_formatter_view() passes along the langcode of the field but if that's und, then entity_translation complains about there being no translation for that.
entityreference solved that with a new setting that always uses the current content language if enabled: https://www.drupal.org/node/1674792. Drupal 8 solved it by expliictly passing the render language down to the formatters.
This is a quick and dirty start of a patch that uses the entity_reference approach but only when the language is und by unsetting the langcode, which means it will fallback to the content language. Also didn't add a setting for it yet, but it probably will need one to be committed. An alternative would be to add a bit more logic and e.g. check for entity_translation and if a translation for current content language is available, then use that explicitly.
Comment | File | Size | Author |
---|---|---|---|
#2 | file-entity-translation-2882373-2.patch | 784 bytes | Berdir |
|
Comments
Comment #2
BerdirHere's a patch. Working for us (tm).
Comment #4
joseph.olstadThanks @berdir