Project

General

Profile

Actions

Bug #99797

closed

Redirects don't respect current language

Added by Phat Hoang about 2 years ago. Updated 12 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
Link Handling & Redirect Handling
Target version:
-
Start date:
2023-02-02
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.


Files

clipboard-202412181155-wzrnx.png (858 KB) clipboard-202412181155-wzrnx.png André Buchmann, 2024-12-18 10:55

Related issues 4 (2 open2 closed)

Related to TYPO3 Core - Bug #99839: Can't append L in additionalParams when using recordLink to redirectNeeds Feedback2023-02-06

Actions
Related to TYPO3 Core - Bug #101156: Record links with L>0 records resolve to page URLs with L=0, also record links ignore the L parameter completlyNew2023-06-23

Actions
Related to TYPO3 Core - Task #102868: Avoid TSFE getSite(), getLanguage(), pageArgumentsClosed2024-01-18

Actions
Related to TYPO3 Core - Task #105987: Add additional `EXT:redirects` functional testsResolvedStefan Bürk2025-01-24

Actions
Actions #1

Updated by Gerrit Code Review about 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77677

Actions #2

Updated by Stefan Bürk about 2 years ago

  • Assignee set to Stefan Bürk

will have a look in the next round.

Actions #3

Updated by Peter Kraume about 1 year ago

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).

Actions #4

Updated by Peter Kraume about 1 year ago

  • Related to Bug #99839: Can't append L in additionalParams when using recordLink to redirect added
Actions #5

Updated by Peter Kraume about 1 year ago

  • Related to Bug #101156: Record links with L>0 records resolve to page URLs with L=0, also record links ignore the L parameter completly added
Actions #6

Updated by Georg Ringer 7 months ago

  • Related to Task #102868: Avoid TSFE getSite(), getLanguage(), pageArguments added
Actions #7

Updated by Georg Ringer 7 months ago

  • Status changed from Under Review to Closed

this has been fixed with #102868 in 12+

Actions #8

Updated by André Buchmann about 2 months ago

@Georg Ringer 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

Actions #9

Updated by Christian Kuhn about 2 months ago

  • Status changed from Closed to New
Actions #10

Updated by Stefan Bürk 16 days ago

  • Related to Task #105987: Add additional `EXT:redirects` functional tests added
Actions #11

Updated by Stefan Bürk 16 days ago · Edited

  • TYPO3 Version changed from 11 to 12

Adding some tests to cover this case (show it has been fixed in main, but not in v12)
with #105987 as preparation.

Actions #12

Updated by Gerrit Code Review 12 days ago

  • Status changed from New to Under Review

Patch set 2 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77677

Actions #13

Updated by Georg Ringer 12 days ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF