Commit 1506c257 authored by Nikita Hovratov's avatar Nikita Hovratov Committed by Georg Ringer
Browse files

[BUGFIX] Fix undefined array key errors

Resolves: #95075
Releases: master
Change-Id: I6c2c9981aac3ccf892767c4205032e8aa2a465e6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/70863

Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarphysikbuddha <r.kaerner@oranto.de>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
parent 5e8886d9
......@@ -267,7 +267,7 @@ class SimpleDataHandlerController
// Traverse elements and make CMD array
foreach ($elements as $key => $value) {
[$table, $uid] = explode('|', $key);
if (!is_array($this->cmd[$table])) {
if (!is_array($this->cmd[$table] ?? null)) {
$this->cmd[$table] = [];
}
if (is_array($this->CB['update'] ?? false)) {
......
......@@ -3330,7 +3330,7 @@ class DataHandler implements LoggerAwareInterface
$copyTCE->start($data, [], $this->BE_USER);
$copyTCE->process_datamap();
// Getting the new UID:
$theNewSQLID = $copyTCE->substNEWwithIDs[$theNewID];
$theNewSQLID = $copyTCE->substNEWwithIDs[$theNewID] ?? null;
if ($theNewSQLID) {
$this->copyMappingArray[$table][$origUid] = $theNewSQLID;
// Keep automatically versionized record information:
......@@ -8055,7 +8055,12 @@ class DataHandler implements LoggerAwareInterface
public function dbAnalysisStoreExec()
{
foreach ($this->dbAnalysisStore as $action) {
$id = BackendUtility::wsMapId($action[4], MathUtility::canBeInterpretedAsInteger($action[2]) ? $action[2] : $this->substNEWwithIDs[$action[2]]);
$idIsInteger = MathUtility::canBeInterpretedAsInteger($action[2]);
// If NEW id is not found in substitution array (due to errors), continue.
if (!$idIsInteger && !isset($this->substNEWwithIDs[$action[2]])) {
continue;
}
$id = BackendUtility::wsMapId($action[4], $idIsInteger ? $action[2] : $this->substNEWwithIDs[$action[2]]);
if ($id) {
$action[0]->writeMM($action[1], $id, $action[3]);
}
......
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