Problem
DomainSourcePathProcessor::processOutbound() uses LanguageInterface::TYPE_CONTENT to determine the langcode for entity translation lookup. It should use TYPE_URL instead, so that the entity translation matches the language conveyed by the URL.
Core's AliasManager::getAliasByPath() explicitly defaults to TYPE_URL with this rationale:
If no language is explicitly specified we default to the current URL language. If we used a language different from the one conveyed by the requested URL, we might end up being unable to check if there is a path alias matching the URL path.
When the content language and URL language diverge (which can happen depending on language negotiation settings), using TYPE_CONTENT can produce incorrect cross-domain rewrites.
Proposed fix
- Change
TYPE_CONTENTtoTYPE_URLfor the langcode fallback - Change the cache context from
languages:language_contenttolanguages:language_url
Issue fork domain-3575977
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:
Issue fork domain_path-3575977
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:
- 3575977-use-typeurl-instead
compare
Comments
Comment #2
mably commentedComment #4
mably commentedComment #6
mably commentedComment #7
mably commentedComment #8
mably commentedNot sure this is any better that what we currently have.