Skip to content

Commit

Permalink
[BUGFIX] Avoid PHP notice in DataHandler
Browse files Browse the repository at this point in the history
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: TYPO3com <noreply@typo3.com>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
  • Loading branch information
liayn authored and ervaude committed Apr 3, 2019
1 parent 2223b06 commit a558bb9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions typo3/sysext/core/Classes/DataHandling/DataHandler.php
Expand Up @@ -1114,7 +1114,7 @@ public function process_datamap()
$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];
Expand All @@ -1131,7 +1131,7 @@ public function process_datamap()
$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') {
Expand Down

0 comments on commit a558bb9

Please sign in to comment.