Commit a558bb96 authored by Markus Klein's avatar Markus Klein Committed by Daniel Goerz
Browse files

[BUGFIX] Avoid PHP notice in DataHandler

The fifth parameter to Datahandler::insertDB() is used in one place
without properly checking for the existence of the array element.
In general this parameter is only used for imp/exp extension
and works for admins only.

Resolves: #88025
Releases: master, 9.5
Change-Id: Iba5656857b1b16fb601a3c6af424a6477edc6956
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60348


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Daniel Goerz's avatarDaniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Daniel Goerz's avatarDaniel Goerz <daniel.goerz@posteo.de>
parent 2223b060
......@@ -1114,7 +1114,7 @@ class DataHandler implements LoggerAwareInterface
$newVersion_placeholderFieldArray['t3ver_wsid'] = $this->BE_USER->workspace;
$newVersion_placeholderFieldArray[$GLOBALS['TCA'][$table]['ctrl']['label']] = $this->getPlaceholderTitleForTableLabel($table);
// Saving placeholder as 'original'
$this->insertDB($table, $id, $newVersion_placeholderFieldArray, false, $incomingFieldArray['uid'] ?? 0);
$this->insertDB($table, $id, $newVersion_placeholderFieldArray, false, (int)($incomingFieldArray['uid'] ?? 0));
// For the actual new offline version, set versioning values to point to placeholder:
$fieldArray['pid'] = -1;
$fieldArray['t3ver_oid'] = $this->substNEWwithIDs[$id];
......@@ -1131,7 +1131,7 @@ class DataHandler implements LoggerAwareInterface
$this->autoVersionIdMap[$table][$this->substNEWwithIDs[$id]] = $phShadowId;
}
} else {
$this->insertDB($table, $id, $fieldArray, false, $incomingFieldArray['uid']);
$this->insertDB($table, $id, $fieldArray, false, (int)($incomingFieldArray['uid'] ?? 0));
}
} else {
if ($table === 'pages') {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment