#62921l10n_mode with relations does not work in Extbase
Description
Original issue is here: https://forge.typo3.org/issues/29293 I believe it is incorrectly closed by Marc Bastian Heinrichs.
Suppose in $TCA:
'documents' => array(
'label' => '...',
'l10n_mode' => 'exclude',
'config' => array(
'allowed' => 'tx_documents_document',
'autoSizeMax' => 30,
'internal_type' => 'db',
'maxitems' => 20,
'max_size' => 128000,
'minitems' => 0,
'foreign_table' => 'tx_documents_document',
'MM' => 'tx_documents_ref',
'MM_foreign_select' => 1,
'MM_match_fields' => array(
'ident' => 'documents'
),
'MM_opposite_field' => 'file_usage',
'prepend_tname' => 1,
'type' => 'group'
)
),
When fetching objects for ‘documents’ field, there should be no language overlay done at all because there are no translated records (l10n_mode=exclude). However doLanguageAndWorkspaceOverlay in typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php does not care and tries to fetch translated records and unsets valid rows in the default language because there are no translated rows (how there can be?). So you always get no docs in languages other than default.
From TCA reference about l10n_mode:
exclude – Field will not be shown in TCEforms if this record is a localization of the default language. (Works basically like a display condition.) Excluded fields will not be copied when a language-copy is made. May have frontend implications similar to “mergeIfNotBlank”.
*mergeIfNotBlank* – Field will be editable but if the field value is blank the value from the default translation is used (this can be very useful for images shared from the default record). Requires frontend support. In the backend the effect is that the field content is not copied when a new “localization copy” is made.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Related issues 5
- Bug #57272Extbase doesn't handle FAL translations correctly
- Bug #65859Support l10n_mode in extbase
- Bug #75851Extbase 110n_mode exclude + repository orderings
- Bug #77754Typo3DbQueryParser does not respect enablefields for translated objects
- Epic #108986Improve MM handling in TYPO3 Core related to language + workspace concepts