Actions
Bug #98352
closedUndefined array key "doktype" in PHP 8 Typo3 11.5.16
Start date:
2022-09-15
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:
Description
Hi,
If the top-page is directly under the root and password-protected, it will create a warning in PHP8:
PHP Warning: Undefined array key "doktype" in /var/www/typo3_src-11.5.16/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php line 1137
$isSpacerOrSysfolder = $this->page['doktype'] PageRepository::DOKTYPE_SPACER || $this->page['doktype'] PageRepository::DOKTYPE_SYSFOLDER;
In this scenario $this->page is empty and $this->page['doktype'] not defined.
$isSpacerOrSysfolder = ($this->page['doktype'] ?? '') PageRepository::DOKTYPE_SPACER || ($this->page['doktype'] ?? '') PageRepository::DOKTYPE_SYSFOLDER; fixes this.
There is the same problem in line 1166 and 1180.
Kind regards
Tomas
Actions