Issue Bug Under Review

#89271Inline (IRRE) records are not kept in sync on record save

Markus Klein 09/25/19, 15:32 updated 11/13/26, 19:24

Description

Setup description

Table “project”

  • translatable
  • IRRE field “assignments” (l10n_mode = exclude)

Table “assignment”

  • not translatable
  • boolean flag “checked” (default 0)

Reproduction

  1. Create a project record and add an assignment in default language => project uid = 1, assignment record uid = 23
  2. Create a translation of the project record => project uid = 2, assignment record uid = 24 (assignments duplicated for the translation, but have no connection to the parent’s assignment 23)
  3. Edit the project again (uid 23) and change the “checked” field to “1” in the assignment
  4. Save the project

Expected behaviour

The assignment associated with the translated project has a value of “1” for the “checked” field.
(The change in the default language has to be mirrored to the translations due to l10n_mode = exclude)

Seen behaviour

The value of the “checked” field of the assignment of the translated project stays unchanged (=0)

Impact

The editor in the Backend changes information in an inline child and wonders why things are not updated in the Frontend for translations.
The workaround for the editor would be to open each and every translation of the parent (project) and save it once.

Analysis

The DataHandler runs a preprocessing of the datamap with the DataMapProcessor.
In this step all inline children of the translations are purged and regenerated based on the default record’s children.
In this phase though, the changed child (assignment) is not yet persisted. Hence, the new translation’s children are generated based on old data.

We see two possible solutions:

  1. Merge the information of the updated assignment from the datamap with the values currently persisted in the database. (this might be very tricky)
  2. Defer the synchronization of the IRRE children of translations until the main datamap processing has been completed. (this is most like the way to go)

Reviews 2

History 1218

  1. Oliver Hader commented and changed status New Needs Feedback priority Must have Should have <span data-processor="relativetime" data-value="2019-09-25T16:45:46+00:00" > 09/25/19, 16:45 </span>

    • How are both tables configured TCA-wise? It is difficult to guess how it’s done…
    • Which field should/might be used in order to determine that assignments with uids 23 and 24 actually are belonging together?
  2. Markus Klein commented and changed status Needs Feedback New <span data-processor="relativetime" data-value="2019-09-25T16:58:01+00:00" > 09/25/19, 16:58 </span>

    TCA Project:

    return [
        'ctrl' => [
            'title' => 'project',
            'label' => 'name',
            'tstamp' => 'tstamp',
            'crdate' => 'crdate',
            'cruser_id' => 'cruser_id',
            'languageField' => 'sys_language_uid',
            'transOrigPointerField' => 'l10n_parent',
            'transOrigDiffSourceField' => 'l10n_diffsource',
            'delete' => 'deleted',
            'enablecolumns' => [
                'disabled' => 'hidden',
                'starttime' => 'starttime',
                'endtime' => 'endtime',
            ],
            'default_sortby' => 'ORDER BY name',
            'searchFields' => '',
            'iconfile' => 'EXT:ext/Resources/Public/Icons/Tables/project.svg',
        ],
    ...
        'columns' => [
            'site_assignment' => [
                'exclude' => false,
                'l10n_mode' => 'exclude',
                'label' => 'assignment',
                'config' => [
                    'type' => 'inline',
                    'foreign_table' => 'tx_ext_domain_model_projectsiteassignment',
                    'foreign_field' => 'project',
                    'appearance' => [
                        'collapseAll' => true,
                        'newRecordLinkAddTitle' => false,
                    ],
                ],
            ],
    ...
        ],
    ];

    TCA Table assignment:

    return [
        'ctrl' => [
            'title'    => 'projectsiteassignment',
            'label' => 'category',
            'tstamp' => 'tstamp',
            'crdate' => 'crdate',
            'cruser_id' => 'cruser_id',
            'iconfile' => 'EXT:ext/Resources/Public/Icons/Tables/project.svg'
        ],
    ...
        'columns' => [
            'project' => [
                'exclude' => false,
                'label' => 'project',
                'config' => [
                    'type' => 'select',
                    'renderType' => 'selectSingle',
                    'foreign_table' => 'tx_ext_domain_model_project',
                    'foreign_table_where' => 'AND tx_ext_domain_model_project.pid=###CURRENT_PID### AND tx_ext_domain_model_project.sys_language_uid IN (-1,0) ORDER BY tx_ext_domain_model_project.name',
                    'enableMultiSelectFilterTextfield' => true,
                    'minitems' => 1,
                    'maxitems' => 1,
                ],
            ],
            'prestige_reference' => [
                'exclude' => false,
                'label' => 'prestige_reference',
                'config' => [
                    'type' => 'check',
                    'items' => [
                        '1' => [
                            '0' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.enabled'
                        ]
                    ],
                    'default' => 0
                ]
            ],
    ...
        ],

    There is no need to have a relation between the assignment records! Those created for the translation of a project are only generated because the core does this (“record unrolling” how I like to call it). This is not technically needed for the use case, where it would suffice to store the assignment once for a project (no matter how it is translated).

    In terms of “record unrolling” the core behaviour is clear and okay (even though it wastes some uids in DB due to the delete and re-create), but there is no other possibility to keep the things in sync. But, the sync has to happen after the assignments in the original language have been persisted not before.

  3. Gerrit Code Review pushed patch set 1 for master to change 62871 status New Under Review <span data-processor="relativetime" data-value="2020-01-13T22:58:20+00:00" > 01/13/20, 22:58 </span>

  4. Dominik Heun commented <span data-processor="relativetime" data-value="2020-06-18T11:56:10+00:00" > 06/18/20, 11:56 </span>

    Hi guys,
    just wanted to ask if we can expect the patch in the next releases?

  5. Paul Beck commented <span data-processor="relativetime" data-value="2020-07-01T14:31:57+00:00" > 07/01/20, 14:31 </span>

    I can confirm this issue in the latest 9 LTS version. It’s very annoying to explain to the users. l10n_mode exclude must work as exptected.

  6. Martin R. Krause commented <span data-processor="relativetime" data-value="2020-07-28T17:47:16+00:00" > 07/28/20, 17:47 </span>

    Can confirm for v9LTS. This is pretty disturbing. There has to be an option to IRRE to NOT be copied when a translation get created. Especially for table pages. Having a relation to pages, which used to have no translation at all is a common design pattern for structured data.

  7. Vladimir Falcon commented <span data-processor="relativetime" data-value="2021-04-22T18:21:55+00:00" > 04/22/21, 18:21 </span>

    I can confirm this problem in TYPO3 V9.5.26 as well.

    The fields types inline and group n:m with MM relations do not respect ‘l10n_mode’ => ‘exclude’ setting. Data ist just lost upon translation.