When selecting "Link image to: content" in the display's settings, the URL generated always use the default language (even if the target content is translated).

There is the same issue in Drupal Core : https://www.drupal.org/project/drupal/issues/2645922#comment-12950464

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Fonski created an issue. See original summary.

fonski’s picture

yoruvo’s picture

Status: Active » Postponed (maintainer needs more info)

Hi Fonski,

thanks for your patch!

Since the function in question is basically just a copy of the Core code, it makes me wonder if I should wait for that core patch to be accepted into the codebase before I accept this patch in this project.

What would you suggest?

agoradesign’s picture

I'd suggest to fix the problem, if it's a known one (and it seems it is - haven't tried on multilingual site though).

The posted patch however is not working, since we don't have the $langcode variable within getMediaThumbnailUrl(). So we have to extend the function's signature and respect this extra parameter when calling the function. Also, I'd put this

danflanagan8’s picture

yoruvo’s picture

Hello everyone,

thank you for the comments! This may help future users follow the root of the problem and find solutions.

Sadly, since the Core discussion of these issues in the original image formatters doesn't seem to have been resolved in any of the myriad issues I've looked at which are related to this problem, it seems like my hands are still bound in terms of a solution here, as again, I am hoping to simply emulate Core code until a Core-internal solution is found.

cbccharlie made their first commit to this issue’s fork.

cbccharlie’s picture

Hello,

Although the problem exists in the CORE, I think it is also important to provide a solution from the module for whoever is using it.
I have created a fork to correct this problem on the development branch and I also upload 2 patches, one for whoever is using version 1.2 and another for whoever is using version 1.3.

Thank you!
Greetings.

cbccharlie’s picture

Status: Postponed (maintainer needs more info) » Needs review

  • yoruvo committed a583b0a4 on 8.x-1.x authored by cbccharlie
    Issue #3030412 by cbccharlie, Fonski: "Link to content" generates only...
yoruvo’s picture

Thank you!

yoruvo’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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