Import fails for records having fields with l10n_mode=exclude and a relation (to sys_file_reference)
How to reproduce:
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
- Export records of a page (!!! including localized records !!!) with a field of localization mode
l10n_mode=excludehaving a relation, e.g. to
sys_file_reference. In my case, I was trying to export/import the carousel content element of
- Try to import
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.
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 the
DataHandlerfrom 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 a
I am currently not aware of any workaround. As mentioned, excluding localized
sys_file_reference records results in the same exception.