Bug #98068
openImport fails for records having fields with l10n_mode=exclude and a relation (to sys_file_reference)
0%
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=exclude
having 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_reference
records) by default, because they are intended to be recreated by theDataHandler
from the parent/source record. They are sanitized within the DataHandler and end-up as unused/invalid in the database (e.g.uid_foreign
is not changed to the new record uid). - Even without those relations, the DataMapProcessor creates an invalid new record (without
pid
value). Therefore, we have to ensure apid
before 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.