Project

General

Profile

Actions

Feature #94539

open

Documentation on how to work with 1:n and n:1 relations and translations

Added by Rozbeh Chiryai Sharahi about 3 years ago. Updated 30 days ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Documentation
Target version:
-
Start date:
2021-07-12
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

While in TYPO3 v8 it was possible to assign relations via default-language-uid, on v9 this is not possible anymore.

Given following example:

Car-table:

uid: 1, name: Some Car
uid: 2, name: Some Car (translation), l10n_parent: 1, sys_language_uid: 1, l10n_parent:1

Owner-table

uid: 1, name: Robert, car: 1
uid: 2, name: Robert (translation), car: 1, sys_language_uid: 1, l10n_parent: 1

Here we are pointing even the translation of Robert to the default language. This was working well in TYPO3 v8 when querying on Extbase for translations:

$query->eq('car.owners.name', 'Robert')

Nevertheless on v9 this query will not work anymore, instead we have to point relations to the translated ID. This is related to the LEFT-JOIN and WHERE clause that is created.

SELECT * FROM car
LEFT JOIN owner ON car.id = owner.car
WHERE car.sys_language_uid=1 -- This can not work in combination with left join of tables where translations are pointing to default language
AND owner.name='Robert'

Conclusion/Suggestion

None of the languageOverlayModes (true, false, 'hideNotTranslated') is compatible with relations that point to original languages, therefore I think this should be stated somewhere. In general there seems to be a lack of extbase translation documentation. Am I right?

Actions

Also available in: Atom PDF