#98068Import fails for records having fields with l10n_mode=exclude and a relation (to sys_file_reference)
Description
Exception:
Uncaught TYPO3 Exception Argument 3 passed to TYPO3\CMS\Core\DataHandling\DataHandler::addDefaultPermittedLanguageIfNotSet()
must be of the type int, null given, called in /var/www/html/public/typo3/sysext/core/Classes/DataHandling/DataHandler.php on line 944
thrown in file /var/www/html/public/typo3/sysext/core/Classes/DataHandling/DataHandler.php in line 7952
How to reproduce:
- Export records of a page (!!! including localized records !!!) with a field of localization mode
l10n_mode=excludehaving a relation, e.g. tosys_file_reference. In my case, I was trying to export/import the carousel content element ofext:bootstrap_package. - Try to import
*Analysis:*
The error occurs during step \TYPO3\CMS\Impexp\Import::setRelation. The reference of sys_file_reference, which originally should be imported, is removed in favor of a new record created as part of the pre-processing of the data map (public/typo3/sysext/core/Classes/DataHandling/DataHandler.php:852). This new record does not provide a pid which leads to this error.
Extract of \TYPO3\CMS\Core\DataHandling\DataHandler::$datamap:
array (
'sys_file_reference' =>
array (
'NEW62e956ae46ee6060038927' =>
array (
'sys_language_uid' => 1,
'l10n_parent' => 'sys_file_reference_3101',
),
),
)
Therefore, it seems like importing localized fields with the l10n_mode=exclude configuration having a relation to another table is currently not working.
- In general, the export should exclude those relations (
sys_file_referencerecords) by default, because they are intended to be recreated by theDataHandlerfrom the parent/source record. They are sanitized within the DataHandler and end-up as unused/invalid in the database (e.g.uid_foreignis not changed to the new record uid). - Even without those relations, the DataMapProcessor creates an invalid new record (without
pidvalue). Therefore, we have to ensure apidbefore executing\TYPO3\CMS\Core\DataHandling\Localization\DataMapProcessor::synchronizeInlineRelations.
*Workaround:*
I am currently not aware of any workaround. As mentioned, excluding localized sys_file_reference records results in the same exception.
Reviews 4
Related issues 2
History 49
-
Nikita Hovratov changed Related to #97684 <span data-processor="relativetime" data-value="2023-03-20T11:04:28+00:00" > 03/20/23, 11:04 </span>
-
Benjamin Franzke changed Duplicated by #110060 <span data-processor="relativetime" data-value="2026-06-16T06:50:09+00:00" > 06/16/26, 06:50 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 94515 status
NewUnder Review <span data-processor="relativetime" data-value="2026-06-16T08:18:55+00:00" > 06/16/26, 08:18 </span> -
Gerrit Code Review pushed patch set 1 for main to change 94516 <span data-processor="relativetime" data-value="2026-06-16T08:20:49+00:00" > 06/16/26, 08:20 </span>
-
Gerrit Code Review pushed patch set 2 for main to change 94516 <span data-processor="relativetime" data-value="2026-06-16T08:26:23+00:00" > 06/16/26, 08:26 </span>
-
Benjamin Franzke changed Related to #110061 <span data-processor="relativetime" data-value="2026-06-16T13:09:02+00:00" > 06/16/26, 13:09 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 96436 <span data-processor="relativetime" data-value="2026-10-06T23:24:22+00:00" > 10/06/26, 23:24 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 96592 <span data-processor="relativetime" data-value="2026-10-10T09:52:42+00:00" > 10/10/26, 09:52 </span>
-
Benjamin Kott commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-10-10T10:40:11+00:00" > 10/10/26, 10:40 </span>
Applied in changeset commit:960fd1d04ee9ae5a1537967e535c5daf9ddcb644.