Bug #98352
closedUndefined array key "doktype" in PHP 8 Typo3 11.5.16
100%
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
Updated by Gerrit Code Review about 2 years ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75746
Updated by Gerrit Code Review about 2 years ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75746
Updated by Gerrit Code Review about 2 years ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75746
Updated by Stefan Bürk about 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset b136c7a3b1be1859fcb30b768b912714b3049afc.
Updated by Gerrit Code Review about 2 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75751
Updated by Stefan Bürk about 2 years ago
- Status changed from Under Review to Resolved
Applied in changeset 7117ba700d44c110c70aea3d9aae5d2fb6e6bad9.