Bug #98509
closedTYPO3\CMS\Core\Error\Exception
100%
Description
Running PHP 8.1:
PHP Warning: Undefined array key "uid" in /var/www/typo3_source/typo3_src-11.5.16/typo3/sysext/fluid/Classes/ViewHelpers/Be/PageInfoViewHelper.php line 77
if (is_array($pageRecord) && $pageRecord['uid']) {
Files
Updated by Georg Ringer about 2 years ago
- Status changed from New to Needs Feedback
how can this be reproduced and isn't that maybe more an issue of ext:staticfilecache (opened https://github.com/lochmueller/staticfilecache/issues/369)
Updated by Claus Harup about 2 years ago
Hi Georg
ext:staticfilecache uses core viewhelper: ViewHelpers/Be/PageInfoViewHelper.php, so it is core related imo.
Simply just add isset():
if (is_array($pageRecord) && isset($pageRecord['uid'])) {
...
}
Updated by Tim Lochmüller about 2 years ago
Hi
I also think it is core related. The screenshot is from the root page (no ID or not selectedable page in this context). The ViewHelper already has a "else" condition for a root page information. But the check is invalid. If an admin call the root page with ID 0, the "readPageAccess" will return "['_thePath' => '/']". This is an array, but there is no uid key. So I suggest extending the check in the core ViewHelper to be bulletproof.
Regards,
Tim
Updated by Gerrit Code Review about 2 years ago
- Status changed from Needs Feedback 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/+/76004
Updated by Gerrit Code Review about 2 years ago
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/+/76014
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 a14a3aae52eb5ab4fad405cc8adc5a68b0fd451c.