Wrong language handling in MediaThumbnailFormatter when linking

Created on 16 April 2018, almost 7 years ago
Updated 16 October 2024, 4 months ago

Problem/Motivation

If you use the thumbnail formatter for a media item and use the option »Link image to« to link to the entity or the media item itself, the link always point to the original language of the entity or the media item. In a multilingual environment the user is loosing the current language by clicking on the link.

Proposed resolution

I adapt the provided solution on 2798977 to the MediaThumbnailFormatter to consider current content language.

Remaining tasks

It would be nice to merge all kind of related issues and provide a fix in one of next releases.

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component

media system

Created by

🇩🇪Germany rwam

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

  • 🇺🇦Ukraine proweb.ua

    #23 work.
    Drupal 10.3.6

  • 🇮🇳India atul_ghate

    I am not able to reproduce this issue on Drupal 11.x. The steps I followed to reproduce are as below:

    1.Clone Drupal 11.x and enable the Language and Content Translation modules.
    2.Change the Manage Display settings for the media type and select the Thumbnail formatter with the Link to entity option enabled.
    3.Create a Media type (image) and enable translation for it. Add an image with an English translation, then add a translation for another
    language for the same media image
    4.Add this media image to an Article node.
    5.When I click on the image, it redirects me to the correct language version of the node.
    Please let me know if there is anything I am missing.

Production build 0.71.5 2024