Issue Bug New Stale

#101156Record links with L>0 records resolve to page URLs with L=0, also record links ignore the L parameter completly

S P 06/23/23, 06:01 updated 06/17/26, 08:49

Description

Having a setup like this:

domain/de is L=0
domain/en is L=1

Having a redirect source domain/shortcut (note: no given language context) with target t3://record?identifier=whatever&uid=123 with a uid 123 from L=1!

This leads to domain/de/detail-page/english-record, which is wrong ( de page with en record). The requested record is correctly fetched and overlayed, but displayed on the wrong site language (which usally is a 404).
In the time of the redirect middleware execution the request has no SiteLanguage attribute set, but the RouteResult attribute already has one (to L=0, whyever this is assumed, I suspect this to be the cause of the problem, but changing the RouteResult language in a custom Middleware is forbidden by an explicit Exception).

Adding the L=1 parameter explicitly to the target link (t3://record?...&L=1) does not change anything, it gets ignored.

Expected behaviour 1: as long as no explicit language is present, a RecordLink should use the language from the record also for the page resolving (let L follow from record.sys_language_uid, instead of just assuming L=0)

Expected behaviour 2: When passing an explicit L to a record link it should be respected by the page resolving, just how it is like adding L to a t3://page?uid=123&L=1 link.

I assume this is also valid when not being in redirect context, but for example in command context, where also no language context is present.

Discovered in v11, probbaly valid in all others as well.

Our current workaround is to always force-append the L parameter in record link configuration,see below. But this should not be needed, but happen implicitly.

config.recordLinks.whatever {
  typolink {
    additionalParams {
       cObject {
         1 = TEXT
         1 {
           data = field:sys_language_uid
           wrap = &L=|
         }

         2 = TEXT
         2 {
           data = field:uid
           wrap = tx_foo_the_usualstuff&tx_foo_record[uid]=|
         }
       }
    }
  }
}

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[BUGFIX] Record links with L>0 records resolve to page URLs with L=0, also record links ignore the L parameter completly Resolves: #101156 Releases: main

History 10

  1. S P commented <span data-processor="relativetime" data-value="2023-06-23T06:27:05+00:00" > 06/23/23, 06:27 </span>

    Just discovered that record links never change the site language at all. Even in regular FE context: be on any regular page in any language (let’s say L=3), where a t3://record link is rendered. If this record is a record from L=5, then we get a link to page L=3 with record from L=5, which is basically the same bug.

    So, record links should always override the global L to the sys_language_uid of the chosen record.

  2. S P commented and changed TYPO3 Version 11 12 <span data-processor="relativetime" data-value="2024-12-18T11:26:32+00:00" > 12/18/24, 11:26 </span>

    RecordLinkHandler is unchanged since forever, so behaviour still present in v12.

  3. S P changed subject Record links with L>0 records resolve to page URLs with L=0 in redirect context Record links with L>0 records resolve to page URLs with L=0, also record links ignore the L parameter completly <span data-processor="relativetime" data-value="2024-12-19T11:22:43+00:00" > 12/19/24, 11:22 </span>

  4. S P commented <span data-processor="relativetime" data-value="2026-06-17T06:38:36+00:00" > 06/17/26, 06:38 </span>

    Wanted to check whether it works on v14, but due to #109912 record link redirects are not working at all (failing with exception), because the request attribute frontend.page.information is not set at this point in time.

  5. S P commented and changed TYPO3 Version 12 14 <span data-processor="relativetime" data-value="2026-06-17T08:49:01+00:00" > 06/17/26, 08:49 </span>

    After working around #109912 I could test this on v14: record links still unconditionally resolve to L=0 when referencing an L>0 uid.

    So, bug still present on v14.