Bug #89768
closedl10n_mode "exclude" does not work with inline type
0%
Description
If I set l10n_mode to "exclude" for inline model, then this model won't be retrieved via its upper model.
Example:
Parent model "Car" has multiple inline "Seat" models with following TCA:
Car:
[ 'ctrl' => [ 'title' => 'Car', 'label' => 'title', 'sortby' => 'sorting', 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', 'delete' => 'deleted', 'versioningWS' => false, 'hideAtCopy' => true, 'transOrigPointerField' => 'l10n_parent', 'transOrigDiffSourceField' => 'l10n_diffsource', 'languageField' => 'sys_language_uid', 'translationSource' => 'l10n_source', 'enablecolumns' => [ 'disabled' => 'hidden', ], 'searchFields' => 'title', 'iconfile' => 'EXT:example/Resources/Public/Icons/car.gif', ], 'interface' => [...], 'types' => [...], 'columns' => [ ... 'seat' => [ 'exclude' => false, 'l10n_mode' => 'exclude', 'label' => 'Seat', 'config' => [ 'type' => 'inline', 'foreign_table' => 'tx_example_domain_model_seat', 'foreign_field' => 'car', ], ], ... ], ]
Seat:
'ctrl' => [ 'title' => 'Seat', 'label' => 'title', 'sortby' => 'sorting', 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', 'delete' => 'deleted', 'versioningWS' => false, 'hideAtCopy' => true, 'languageField' => 'sys_language_uid', 'enablecolumns' => [ 'disabled' => 'hidden', ], 'searchFields' => 'title,', 'iconfile' => 'EXT:example/Resources/Public/Icons/seat.gif', ], ...
If I now create a car with several seats and translate it, then seats are not visible in the translated model (in TYPO3) as expected. If I then try to get it via repository in the frontend, then the translated car has no seats.
Updated by Benni Mack over 4 years ago
- Related to Bug #82657: l10n_mode exclude ignored in repository added
Updated by Benni Mack over 4 years ago
- Status changed from New to Needs Feedback
Hi Michael,
can you share your Model and your code to persist?
Updated by Jonas Eberle over 4 years ago
The problem might not be Extbase-related. I think Extbase does not have to retrieve the default language model.
According to https://docs.typo3.org/m/typo3/reference-tca/master/en-us/Columns/Index.html#l10n-mode 'l10n_mode': 'exclude' is supposed to keep translated values in sync through DataHandler.
This does not work for me with TCA type 'inline'. When updating the default language, the translated records are NOT kept in sync.
Example for a 1:n relation (`main <-- 1:n --> related`).
'columns' => [ ... 'related' => [ 'l10n_mode' => 'exclude', 'config' => [ 'type' => 'inline', 'foreign_table' => 'tx_xxx_domain_model_related', 'foreign_field' => 'main', ...
Updated by Oliver Hader over 3 years ago
The language aspect seems to be missing for the child Seat
table - it lacks the possibility to reference to their corresponding parent language records - specifically at least l10n_parent
is missing.
Thus, please try to either
a) remove tx_example_domain_model_seat
definition for languageField
Seat
table is "monoglot" then and should™ be working
b) add tx_example_domain_model_seat
definition transOrigPointerField
Seat
entities now know about their language ancestors- that also implies that synchronization on the parent level
Car
works for their children as well
I'm not completely sure whether something in the Extbase data-retrieval (ORM) layer is missing in addition.
Updated by Oliver Hader over 3 years ago
- Tags changed from tca, l10n_mode exclude,inline type to tca, l10n_mode exclude,inline type, pending-close
Updated by Oliver Hader almost 3 years ago
- Status changed from Needs Feedback to Closed
Closing this issue. Feel free to reopen in case the problem occurs again.
Updated by Anonymous almost 2 years ago
Jonas Eberle wrote in #note-3:
The problem might not be Extbase-related. I think Extbase does not have to retrieve the default language model.
According to https://docs.typo3.org/m/typo3/reference-tca/master/en-us/Columns/Index.html#l10n-mode 'l10n_mode': 'exclude' is supposed to keep translated values in sync through DataHandler.
This does not work for me with TCA type 'inline'. When updating the default language, the translated records are NOT kept in sync.
Example for a 1:n relation (`main <-- 1:n --> related`).
[...]
How to overcome this?