Project

General

Profile

Actions

Bug #97684

open

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

Added by Lina Wolf over 2 years ago. Updated about 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

Also available in: Atom PDF