Hi,
when using "Content" language negotiation, I would expect to be able to change (as far as possible) the content language and interface language independently one form the other, but there are still some issues that prevent that, see the meta-issue #2860901: Doubts about Content language negotiation.
One of the things I noticed is that LanguageNegotiationContentEntity::processOutbound()
operates only when these conditions are met:
- URL points to an entity;
- AND it refers to the current request.
The result of this is that on non-entity pages, like for instance the front page, a link to an entity would change the interface language because the query string to change the content language is missing.
Look at the image:
This could be fixed by relaxing the conditions from above in LanguageNegotiationContentEntity::meetsContentEntityRoutesCondition()
.
A tentative patch is on its way.
Thanks,
Antonio
Comment | File | Size | Author |
---|---|---|---|
#8 | interdiff-2863465-5-8-do-not-test.diff | 639 bytes | ao2 |
#8 | LanguageNegotiationContentEntity_make_links_to_entities_only_change_the_content_language-2863465-8.patch | 2.05 KB | ao2 |
Comments
Comment #2
ao2 CreditAttribution: ao2 as a volunteer commentedPatch attached.
The result is like in this image:
Comment #4
ao2 CreditAttribution: ao2 as a volunteer commentedUploaded a new patch, the previous one was made against drupal-core and failed to apply because the file paths in the diff header were off (missing
core/
subdir in the paths).Comment #5
ao2 CreditAttribution: ao2 as a volunteer commentedUpdated patch, changes since the previous version:
getContentEntityTypeIdForCurrentRequest()
method, it will be useful in another fix I am working on.Thanks,
Antonio
Comment #7
ao2 CreditAttribution: ao2 as a volunteer commentedComment #8
ao2 CreditAttribution: ao2 as a volunteer commentedAdjusting the tests to consider the new behavior when the current request is not an entity route.
Comment #9
penyaskitoI didn't look in detail to the patch, but modifying this test removing assertions doesn't look right to me unless there is a justified reason.
Could we add another test for the use case we are covering here? That will make the issue more understandable and without introducing any regressions.
Comment #10
ao2 CreditAttribution: ao2 as a volunteer commented@penyaskito I can add a test, sure, but I'd like to know first if the problem itself is recognized as valid.
Are the images above clear enough?
Thanks,
Antonio
Comment #11
plachI was not able to replicate this, see #2860901-13: Doubts about Content language negotiation: can you double check on the latest HEAD and post the exact steps to reproduce it on a fresh installation? Ideally even a DB dump along with the commit hash, if it's a test site.
Comment #19
quietone CreditAttribution: quietone at PreviousNext commented@ao2, Thank you for reporting this problem. We rely on issue reports like this one to resolve bugs and improve Drupal core.
There has been no activity here for 5 years.
More information about this issue was asked for in #11, 5 years ago, when plach reported they could not reproduce the problem. No additional information has been supplied, therefor closing.
If you are experiencing this problem on a supported version of Drupal reopen the issue, by setting the status to 'Active', and provide complete steps to reproduce the issue (starting from "Install Drupal core").
Thanks!