Commit 48975aef authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[BUGFIX] Prevent undefined array key warnings in RecordHistory

Occurred on accessing the record history
for records on pid=0.

Resolves: #97682
Releases: main, 11.5
Change-Id: I041fd9c2dfa8f8cfda4f89c47d320e5bfa6e7f3a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74733


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent 1c0cf77e
......@@ -434,7 +434,7 @@ class RecordHistory
$deletedField = $GLOBALS['TCA']['pages']['ctrl']['delete'];
$fields = 'pid,' . $deletedField;
$pageRecord = BackendUtility::getRecord('pages', $pageId, $fields, '', false);
$isDeletedPage = (bool)$pageRecord[$deletedField];
$isDeletedPage = (bool)($pageRecord[$deletedField] ?? false);
}
if ($isDeletedPage) {
// The page is deleted, so we fake its uid to be the one of the parent page.
......
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