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
Issue fork media_responsive_thumbnail-3030412
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
Comment #2
fonski commentedComment #3
yoruvo commentedHi 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?
Comment #4
agoradesign commentedI'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
Comment #5
danflanagan8Thanks for this module!
While this issue may be important, I think there's a good chance this issue is the result of an issue (or issues) with drupal core. See
Since this module unites these two core features which each have this bug, I am not surprised this module has the same bug!
The parent issue of both of these is #3061761: The language of content entities incorrectly falls back to the default language of the content whilst ignoring the current language of the user.
Comment #6
yoruvo commentedHello 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.
Comment #9
cbccharlie commentedHello,
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.
Comment #10
cbccharlie commentedComment #12
yoruvo commentedThank you!
Comment #13
yoruvo commented