Bug #89768

l10n_mode "exclude" does not work with inline type

Added by Michal Majernik 11 months ago. Updated 3 months ago.

Status:
Needs Feedback
Priority:
Should have
Category:
Extbase + l10n
Target version:
-
Start date:
2019-11-25
Due date:
% Done:

0%

TYPO3 Version:
10
PHP Version:
7.2
Tags:
tca, l10n_mode exclude,inline type
Complexity:
Is Regression:
Sprint Focus:

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.


Related issues

Related to TYPO3 Core - Bug #82657: l10n_mode exclude ignored in repository New 2017-10-03

History

#1 Updated by Benni Mack 5 months ago

  • Related to Bug #82657: l10n_mode exclude ignored in repository added

#2 Updated by Benni Mack 5 months ago

  • Status changed from New to Needs Feedback

Hi Michael,

can you share your Model and your code to persist?

#3 Updated by Jonas Eberle 3 months 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',
...

Also available in: Atom PDF