Project

General

Profile

Actions

Bug #89768

closed

l10n_mode "exclude" does not work with inline type

Added by Michal Majernik over 4 years ago. Updated over 1 year ago.

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

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.2
Tags:
tca, l10n_mode exclude,inline type, pending-close
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 1 (1 open0 closed)

Related to TYPO3 Core - Bug #82657: l10n_mode exclude ignored in repositoryNew2017-10-03

Actions
Actions #1

Updated by Benni Mack almost 4 years ago

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

Updated by Benni Mack almost 4 years ago

  • Status changed from New to Needs Feedback

Hi Michael,

can you share your Model and your code to persist?

Actions #3

Updated by Jonas Eberle almost 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',
...

Actions #4

Updated by Oliver Hader almost 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.

Actions #5

Updated by Oliver Hader almost 3 years ago

  • Tags changed from tca, l10n_mode exclude,inline type to tca, l10n_mode exclude,inline type, pending-close
Actions #6

Updated by Oliver Hader over 2 years ago

  • Status changed from Needs Feedback to Closed

Closing this issue. Feel free to reopen in case the problem occurs again.

Actions #7

Updated by Anonymous over 1 year 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?

Actions

Also available in: Atom PDF