From 7e49839c7df4a9a235a47ebe9984247d554bc876 Mon Sep 17 00:00:00 2001
From: Georg Ringer <georg.ringer@gmail.com>
Date: Fri, 10 Feb 2023 09:08:54 +0100
Subject: [PATCH] [BUGFIX] Fix PHP 8 warning in TypoScriptFrontendController

Added Null coalescing operator, when accessing
$this->register['SYS_LASTCHANGED'].

Resolves: #99876
Releases: main, 11.5
Change-Id: I56a94d20195fdb82000259fdbe3e2eb723695383
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77819
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
---
 .../Classes/Controller/TypoScriptFrontendController.php         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
index cc417874088a..c261fd3d4418 100644
--- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
+++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
@@ -2417,7 +2417,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
     protected function setSysLastChanged()
     {
         // We only update the info if browsing the live workspace
-        if ($this->page['SYS_LASTCHANGED'] < (int)$this->register['SYS_LASTCHANGED'] && !$this->doWorkspacePreview()) {
+        if ($this->page['SYS_LASTCHANGED'] < (int)($this->register['SYS_LASTCHANGED'] ?? 0) && !$this->doWorkspacePreview()) {
             $connection = GeneralUtility::makeInstance(ConnectionPool::class)
                 ->getConnectionForTable('pages');
             $pageId = $this->page['_PAGES_OVERLAY_UID'] ?? $this->id;
-- 
GitLab