Feature #94539
openDocumentation on how to work with 1:n and n:1 relations and translations
0%
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?