Issue Bug Closed

#89768l10n_mode "exclude" does not work with inline type

Michal Majernik 11/25/19, 11:51 updated 10/17/26, 19:15

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.

Reviews 2

History 14

  1. Benni Mack commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2020-05-12T21:28:55+00:00" > 05/12/20, 21:28 </span>

    Hi Michael,

    can you share your Model and your code to persist?

  2. Jonas Eberle commented <span data-processor="relativetime" data-value="2020-07-19T18:43:32+00:00" > 07/19/20, 18:43 </span>

    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',
    ...
  3. Oliver Hader commented <span data-processor="relativetime" data-value="2021-05-05T13:43:31+00:00" > 05/05/21, 13:43 </span>

    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.

  4. Oliver Hader changed Tags tca, l10n_mode exclude,inline type tca, l10n_mode exclude,inline type, pending-close <span data-processor="relativetime" data-value="2021-05-05T13:43:51+00:00" > 05/05/21, 13:43 </span>

  5. Oliver Hader commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2022-01-10T19:35:12+00:00" > 01/10/22, 19:35 </span>

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

  6. Anonymous commented <span data-processor="relativetime" data-value="2023-01-12T10:18:05+00:00" > 01/12/23, 10:18 </span>

    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?

  7. Jan Kornblum commented <span data-processor="relativetime" data-value="2025-01-06T16:56:50+00:00" > 01/06/25, 16:56 </span>

    Still an issue… And in addition we should have the possibility to (absolutely) deny auto creation of children when parent gets localized. In my opinion l10n_mode => exclude should behave that way. Or else bringing the old option localizeChildrenAtParentLocalization back?

  8. Georg Ringer commented and changed status Closed Accepted <span data-processor="relativetime" data-value="2025-01-07T08:06:15+00:00" > 01/07/25, 08:06 </span>

    reopened as request from jan

  9. Alexander Schnitzler commented <span data-processor="relativetime" data-value="2026-10-17T19:14:54+00:00" > 10/17/26, 19:14 </span>

    I could not reproduce this on main, nor on 13.4, 12.4, 11.5 or 10.4: in all of them DataHandler copies the children into the translation on localize, and Extbase reads the copies for the translated parent, with overlays off, mixed and on. Versions before 10.4 could not be tested anymore.

    When a record whose inline field has 'l10n_mode' => 'exclude' is localized, DataHandler copies the child records into the translation: children of a language aware table are localized (with l18n_parent), children of a table without language field are copied (with t3_origuid). This is covered by core tests:

    How Extbase handles fields with l10n_mode exclude compared to core is covered by the test suite added in f8b8ae65b76 (96683, #111055). For reading, Extbase returns the copies of the translation, as core does when it resolves relations of a translated record:

    Where Extbase still differs from core when writing (e.g. keeping the copies in sync when the default record changes), the suite pins this as skipped tests.

    This also holds for the setup from the report, a child table with a language field but without transOrigPointerField: the translated Car returns its Seats. For child tables without a language field, c3642829a32 (88837, #90997, #88063) removed a “Localization failed” log entry; it is part of 14.3.0. Up to 13.4 that entry is still written, but the copies are created as well.

    The remaining request, to deny the automatic creation of children when the parent is localized or to bring back localizeChildrenAtParentLocalization, is a DataHandler feature and would change what the core tests above define. Please open a separate feature request for it.

    Closing this one as not reproducible.

    If you think this is a mistake, please provide a explanation on how to verify this on main or 14.3 please.
    If you want the DataHandler to change, please open a new ticket in another category.