Thumbnail is not language-aware

Created on 17 March 2017, over 7 years ago
Updated 27 October 2023, about 1 year ago

Problem/Motivation

When (re)generating the thumbnail of a media entity (using custom code #2798251: Thumbnail not updated or with #2749695: Thumbnail not updated ), the thumbnail generated in automaticallySetThumbnail is stored for all languages, even if the data used by the plugin to generate the thumbnail is translatable.

Steps to reproduce:

  • Use a patch to update media thumbnails
  • Use media_entity_image with a translatable image field
  • Create an image media entity with image A for a language (say, en)
  • (thumbnail will be generated for image A)
  • Translate this entity to another language (say, de) and use image B instead
  • (thumbnail will be generated for image B)

Expected result:
The English media translation uses thumbnail based on image A while the German media translation uses a thumbnail based on image B.

Actual result:
Both the English and German translations use the thumbnail based on image B (the most recent).

Proposed resolution

Would it be enough to mark the thumbnail as translatable?

Remaining tasks

Add tests, decide on an approach and implement it.

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany ckaotik Berlin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇷🇸Serbia miksha

    If you use patch #134 from https://www.drupal.org/project/drupal/issues/2983456 Expose triggering update of media metadata + thumbnail to end users Needs work and enable file translation for media image at "/admin/config/regional/content-language" and also set "translatable elements" in the bottom of "/admin/structure/media/manage/image/fields/media.image.field_media_image" then thumbnail translation works. Patch that is attached here is already included in patch #134 I mentioned above.

Production build 0.71.5 2024