Context:
In my project, I force interface language to be always the same ; it helps content manager to get the interface in a language they know (sometimes they have to fix few things in a language they don't know so it helps).
Problem:
If interface language (let's say English) and content language (let's say Chinese) don't match, if there is a redirection for the current URL (in Chinese), it won't match anything in the DB since it searches for a match in the DB with interface language (English).
In "src/EventSubscriber/RedirectRequestSubscriber.php" at line 137 we have :
$redirect = $this->redirectRepository->findMatchingRedirect($path, $request_query, $this->languageManager->getCurrentLanguage()->getId());
and "getCurrentLanguage" code is :
public function getCurrentLanguage($type = LanguageInterface::TYPE_INTERFACE)
so it takes interface language and there is no match.
Solution:
Use "getCurrentLanguage" with "LanguageInterface::TYPE_CONTENT" as param.
Questions:
Any impact? Or is there any reason to use the interface language?