Bug #100002
openBidirectional "allowLanguageSynchronization" including "l10n_mode => exclude" not possible with a MM relation
0%
Description
Working on TYPO3 11LTS (latest patch release) we try to achieve a MM relation between two entities in our case "products" and "downloads" that can be edited from both sides (bidirectional) and have "allowLanguageSynchronization" including "l10n_mode => exclude" activated.
So the editor just sets the relation in the default language 0 with the following TCA setup:
// Local side (tx_test_domain_model_product)
'downloads' => [
'exclude' => 1,
'label' => 'Related downloads',
'config' => [
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'foreign_table' => 'tx_test_domain_model_download',
'foreign_table_where' => 'AND {#tx_test_domain_model_download}.{#pid} = ###PAGE_TSCONFIG_ID### AND tx_test_domain_model_download.sys_language_uid IN (-1,0)',
'MM' => 'tx_test_domain_model_productsdownloads_mm',
'behaviour' => [
'allowLanguageSynchronization' => true,
],
],
'l10n_mode' => 'exclude',
'l10n_display' => 'defaultAsReadonly',
],
// Foreign side (tx_test_domain_model_download)
'products' => [
'exclude' => 1,
'label' => 'Connected products',
'config' => [
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'foreign_table' => 'tx_test_domain_model_product',
'foreign_table_where' => 'AND {#tx_test_domain_model_product}.{#pid}=###PAGE_TSCONFIG_ID### AND tx_test_domain_model_product.sys_language_uid IN (-1,0)',
'MM' => 'tx_test_domain_model_productsdownloads_mm',
'MM_opposite_field' => 'downloads',
'behaviour' => [
'allowLanguageSynchronization' => true,
],
],
'l10n_mode' => 'exclude',
'l10n_display' => 'defaultAsReadonly',
],
Depending on which side we are editing the relation in the backend the result is the following in the MM table. Screenshots show both cases.
1: local side editing
2: foreign side editing
So the language synchronisation does work for one side but not for both. Depending from which side we update (save) the entities in the backend we can switch the db state between the two states (screenshots) in the MM table.
Is this a bug or simply not supported? Since it is a common use case it should be supported. Especially with a lot of languages it makes sense to just edit these relations in the default language and have a language sync activated.
Files
Updated by Martin Neumann 8 months ago
ยท Edited
I can completely confirm this problem for v12.4. It's very frustrating as it completely prevents working with bidirectional relations.
Updated by Matthias Krappitz 8 months ago
Can also confirm there is problems in 12.4.16. Looks to me that bidirectional TCA relations don't work properly with multilanguage records. In my case when editing from the foreign side, suddenly relations to translation overlay records (sys_language_uid > 0) where written into the MM table, even though I disabled this via a SQL condition (sys_language_uid IN (-1,0)) in the foreign_table_where TCA setting on local and foreign side of the relation.