Bug #101156
openRecord links with L>0 records resolve to page URLs with L=0, also record links ignore the L parameter completly
0%
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]=| } } } } }
Updated by S P over 1 year ago
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.
Updated by Eric Harrer over 1 year ago
- Related to Epic #101557: Translation Handling Findings added
Updated by Jo Hasenau over 1 year ago
- Related to deleted (Epic #101557: Translation Handling Findings)
Updated by Astrid Haubold over 1 year ago
- Related to Story #101565: Frontend related translation issues added
Updated by Peter Kraume about 1 year ago
- Related to Bug #99797: Redirects don't respect current language added
Updated by S P about 2 months ago
- TYPO3 Version changed from 11 to 12
RecordLinkHandler is unchanged since forever, so behaviour still present in v12.
Updated by S P about 2 months ago
- Subject changed from Record links with L>0 records resolve to page URLs with L=0 in redirect context to Record links with L>0 records resolve to page URLs with L=0, also record links ignore the L parameter completly