Project

General

Profile

Actions

Bug #97684

open

DataHandler::addDefaultPermittedLanguageIfNotSet gets called with $pageId===null

Added by Lina Wolf almost 2 years ago. Updated almost 2 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2022-05-24
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I was doing an import of a hierarchical page tree. The import on level 1 failed (due to a missing default value for the database).

In line 7416 of the data handler this lead to just not creating the page record. It creates an entry in the log but does not fail the import.

Now uppon importing the next page the desired root page does not exists.

The local variable `$theRealPid` is not type-safe however and even initialized with "null" in line 885. However `$theRealPid` is used in line 944 as third parameter
of addDefaultPermittedLanguageIfNotSet. If it is still null here this causes a type error as the method only allows an integer as third parameter. This causes a hard to debug error as the actual problem happened not with the record in question but the previous record.

Chaning line 944 to `$this->addDefaultPermittedLanguageIfNotSet($table, $incomingFieldArray, $theRealPid ?? 0);` the import - of course - still fails. However instead of a php type error I get a propper error in the Import/Export tool.

TYPO3 11.5.10, reproduced on current 11.5 branch of the mono-repository. Didn't check on main yet.


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #98068: Import fails for records having fields with l10n_mode=exclude and a relation (to sys_file_reference)New2022-08-02

Actions
Actions #1

Updated by Daniel Haupt almost 2 years ago

I got the same error message while importing, but probably for a different reason.

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.phpin line 7952

In my case, the error occurs during \TYPO3\CMS\Impexp\Import::setRelation related to a field of l10n_mode=exclude which references a sys_file_reference.
The reference, which originally should be created as part of the import, is removed in favor of a new record created as part of the pre-processing of the datamap (public/typo3/sysext/core/Classes/DataHandling/DataHandler.php:852). This new record does not provide a pid which leads to this error.

Therefore, it seems like importing localized fields with the l10n_mode=exclude configuration is currently not working.

Actions #2

Updated by Nikita Hovratov about 1 year ago

  • Related to Bug #98068: Import fails for records having fields with l10n_mode=exclude and a relation (to sys_file_reference) added
Actions

Also available in: Atom PDF