\media_wysiwyg_token_to_markup() receives $langcode but doesn't use it for the file_view() call. This was added in #2129273: Pass langcode to media_wysiwyg_token_to_markup resolving media alt attributes in interface and since it was even added to the legacy field_attach mode, I can only assume that was a simple oversight.

This is a problem because the field system builds and caches the safe_value already during file_load, for all languages. Without passing it along, they're all displayed in the same language. Or not at all, if you disable the language fallback.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir created an issue. See original summary.

Berdir’s picture

joseph.olstad’s picture

Status: Needs review » Reviewed & tested by the community

Thanks

  • joseph.olstad committed 92ab9d7 on 7.x-2.x authored by Berdir
    Issue #2949151 by Berdir: $langcode is not passed to file_view() in...

  • joseph.olstad committed 92ab9d7 on 7.x-3.x authored by Berdir
    Issue #2949151 by Berdir: $langcode is not passed to file_view() in...

  • joseph.olstad committed 92ab9d7 on 7.x-4.x authored by Berdir
    Issue #2949151 by Berdir: $langcode is not passed to file_view() in...
joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.