#99797Redirects don't respect current language
Description
My installation has multiple domains with different language:
my-domain.se (default)
my-domain.dk
The redirects only go to the default language.
Here are the redirect scenarios that don’t work as expected:
1)
Source domain: my-domain.dk
Source path: /source-path-dk
Source target: t3://page?uid=1405
When visiting: my-domain.dk/source-path-dk
Expected redirect: my-domain.dk/dk-page
Actual redirect: my-domain.se/se-page
2)
Source domain: *
Source path: /source-path
Source target: t3://page?uid=1405
When visiting: my-domain.dk/source-path
Expected redirect: my-domain.dk/dk-page
Actual redirect: my-domain.se/se-page
The same happens when linking to records using RecordLinkHandler.
The problem seems to be in bootFrontendController in RedirectService where it instantiates TSFE where it passes the $site->getDefaultLanguage() to the “siteLanguage” parameter.
I checked the middleware TypoScriptFrontendInitialization how it creates the TypoScriptFrontendController.
It passes $request->getAttribute(‘language’, $site->getDefaultLanguage()) to the “siteLanguage” and when I did the same change the scenarios above work as expected.
Reviews 4
Related issues 4
- Bug #99839Can't append L in additionalParams when using recordLink to redirect
- Bug #101156Record links with L>0 records resolve to page URLs with L=0, also record links ignore the L parameter completly
- Task #102868Avoid TSFE getSite(), getLanguage(), pageArguments
- Task #105987Add additional `EXT:redirects` functional tests
Files 1
History 1214
-
Gerrit Code Review pushed patch set 1 for main to change 77677 status
NewUnder Review <span data-processor="relativetime" data-value="2023-02-03T06:59:17+00:00" > 02/03/23, 06:59 </span> -
Stefan Bürk commented and changed assigned to Stefan Bürk <span data-processor="relativetime" data-value="2023-02-05T19:31:51+00:00" > 02/05/23, 19:31 </span>
-
Peter Kraume commented <span data-processor="relativetime" data-value="2023-11-30T13:21:25+00:00" > 11/30/23, 13:21 </span>
I just tested the patch with TYPO v11.5 and it works perfectly for me for pages and also records (t3://record?identifier=foobar&uid=5).
-
Peter Kraume changed Related to #99839 <span data-processor="relativetime" data-value="2023-11-30T13:23:24+00:00" > 11/30/23, 13:23 </span>
-
Peter Kraume changed Related to #101156 <span data-processor="relativetime" data-value="2023-11-30T13:24:23+00:00" > 11/30/23, 13:24 </span>
-
Georg Ringer changed Related to #102868 <span data-processor="relativetime" data-value="2024-07-10T18:57:24+00:00" > 07/10/24, 18:57 </span>
-
Georg Ringer commented and changed status
Under ReviewClosed <span data-processor="relativetime" data-value="2024-07-10T19:08:15+00:00" > 07/10/24, 19:08 </span>this has been fixed with #102868 in 12+
-
André Buchmann commented and changed attached clipboard-202412181155-wzrnx.png <span data-processor="relativetime" data-value="2024-12-18T10:56:43+00:00" > 12/18/24, 10:56 </span>
@just2b we used the abandoned patch in TYPO3 11.5 successfully for our redirects.
After the upgrade to 12.4.24 we removed the patch and tried it again. The issue is not fixed for us.
It only works when I apply the same patch again here: https://github.com/typo3/typo3/blob/3dcf63dcbbfdd108aa4ce2207b27fc80b7eb8995/typo3/sysext/redirects/Classes/Service/RedirectService.php#L410-L410
-
Christian Kuhn changed status
ClosedNew <span data-processor="relativetime" data-value="2024-12-18T11:33:38+00:00" > 12/18/24, 11:33 </span> -
Stefan Bürk changed Related to #105987 <span data-processor="relativetime" data-value="2025-01-24T16:44:41+00:00" > 01/24/25, 16:44 </span>
-
Stefan Bürk commented and changed TYPO3 Version
1112 <span data-processor="relativetime" data-value="2025-01-24T16:59:35+00:00" > 01/24/25, 16:59 </span>Adding some tests to cover this case (show it has been fixed in main, but not in v12)
with #105987 as preparation. -
Gerrit Code Review pushed patch set 2 for 12.4 to change 77677 status
NewUnder Review <span data-processor="relativetime" data-value="2025-01-28T12:40:45+00:00" > 01/28/25, 12:40 </span> -
Georg Ringer commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-01-28T12:55:09+00:00" > 01/28/25, 12:55 </span>Applied in changeset commit:69ff59ef8b13c6e401b2900e2e370036cbcdd850.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-12-02T14:33:58+00:00" > 12/02/25, 14:33 </span>
will have a look in the next round.