Issue Bug Closed

#88063DataHandler checks parent instead of inline table on localization

Philipp Schlosser 04/03/19, 16:40 updated 04/21/26, 11:30

Description

DataHandler line 4107: copyRecord_processInline()

4125: // If language is set and differs from original record, this isn't a copy action but a localization of our parent/ancestor:
4126: if ($language > 0 && BackendUtility::isTableLocalizable($table) && $language != $row[$GLOBALS['TCA'][$table]['ctrl']['languageField']]) {
4127:     // Children should be localized when the parent gets localized the first time, just do it:
4128:     $newId = $this->localize($v['table'], $v['id'], $language);
4129: }

In line 4126 it is checked if the parent but not the child table is localizable.
This leads to the following problem:
If you try to localize a record e.g. a download(localizable) which holds multiple downloadfiles(table is not localizable), an error is thrown that says :
’1: Localization failed; “languageField” and “transOrigPointerField” must be defined for the table …’

Reviews 1

Files 1

History 912

  1. Markus Klein commented <span data-processor="relativetime" data-value="2019-08-01T09:45:41+00:00" > 08/01/19, 09:45 </span>

    @Philipp Can you please push a patch to Gerrit?

  2. Pascal Rinker commented <span data-processor="relativetime" data-value="2019-08-06T13:59:44+00:00" > 08/06/19, 13:59 </span>

    I had the same problem couple of weeks ago and debugged this “issue” until I determined that it´s more a feature than a bug. In TYPO3 9 the DataHandler copies your records if you´re going to localize them. Those records are in the same table and have the same values than the original if you set `l10n_mode = exclude`. In my opinion are these fields required for the DataHandler to know which record contains which language and what the original uid was.

  3. Sven Burkert commented and changed attached test.zip TYPO3 Version 9 13 PHP Version 7.2 8.4 <span data-processor="relativetime" data-value="2025-12-05T11:24:32+00:00" > 12/05/25, 11:24 </span>

    Still a problem in TYPO3 v13.
    I’ve added a demo extension for reproducing the problem.
    Not only an error message is shown, but on every save of a record from default language a translation entry in the inline table is created.

  4. Sven Burkert commented <span data-processor="relativetime" data-value="2025-12-05T16:51:21+00:00" > 12/05/25, 16:51 </span>

    I guess I have fixed this now, all I had to do is to remove TCA configuration option “l10n_mode=exclude”.
    And add this configuration to disable editing in alternative languages:

                    'appearance' => [
                        'showPossibleLocalizationRecords' => 1,
                        'showAllLocalizationLink' => 0,
                        'showNewRecordLink' => 0,
                    ],

    And add this in Domain Model in getter:

        public function getField(): ObjectStorage
        {
            $this->_localizedUid = $this->uid;
            return $this->field;
        }

    Means, “l10n_mode=exclude” results to wrong and unexpected results.

  5. Torben Hansen commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-04-11T11:40:07+00:00" > 04/11/26, 11:40 </span>

    Applied in changeset commit:c3642829a320c4b5e131b352fc5adefa67242cb6.