Bug #95618
closedUndefined array key warning in PageRenderer - FE exception
100%
Description
Hi upgraded to new 11.5 and trying PHP 8. Get FE exception warning about undefined array key when loading any FE page.
at TYPO3\CMS\Core\Error\ErrorHandler->handleError(2, 'Undefined array key "defer"', '/home/<snipped>/public_html/typo3/sysext/core/Classes/Page/PageRenderer.php', 2213)
in /home/<snipped>/public_html/typo3/sysext/core/Classes/Page/PageRenderer.php line 2213
foreach ($this->jsLibs as $properties) {
$properties['file'] = $this->getStreamlinedFileName($properties['file']);
$type = $properties['type'] ? ' type="' . htmlspecialchars($properties['type']) . '"' : '';
$async = $properties['async'] ? ' async="async"' : '';
line 2213 $defer = $properties['defer'] ? ' defer="defer"' : '';
$nomodule = $properties['nomodule'] ? ' nomodule="nomodule"' : '';
$integrity = $properties['integrity'] ? ' integrity="' . htmlspecialchars($properties['integrity']) . '"' : '';
$crossorigin = $properties['crossorigin'] ? ' crossorigin="' . htmlspecialchars($properties['crossorigin']) . '"' : '';
$tag = '<script src="' . htmlspecialchars($properties['file']) . '"' . $type . $async . $defer . $integrity . $crossorigin
Updated by mark roemermann about 3 years ago
Not a programmer, but this seems to fix it for me and allow FE to render?
foreach ($this->jsLibs as $properties) {
$properties['file'] = $this->getStreamlinedFileName($properties['file']);
$type = ($properties['type'] ?? null)? ' type="' . htmlspecialchars($properties['type']) . '"' : '';
$async = ($properties['async'] ?? null)? ' async="async"' : '';
$defer = ($properties['defer']?? null) ? ' defer="defer"' : '';
$nomodule = ($properties['nomodule'] ?? null) ? ' nomodule="nomodule"' : '';
$integrity = ($properties['integrity'] ?? null) ? ' integrity="' . htmlspecialchars($properties['integrity']) . '"' : '';
$crossorigin = ($properties['crossorigin'] ?? null)? ' crossorigin="' . htmlspecialchars($properties['crossorigin']) . '"' : '';
$tag = '<script src="' . htmlspecialchars($properties['file']) . '"' . $type . $async . $defer . $integrity . $crossorigin . $nomodule . '></script>';
Updated by Gerrit Code Review about 3 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71639
Updated by Gerrit Code Review about 3 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71639
Updated by Oliver Bartsch about 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset a91fa19394aa60957f340ea996bcb172e0e874c4.
Updated by Christian Kuhn about 3 years ago
- Has duplicate Bug #95654: Error with concatenateJs : PHP Warning: Undefined array key "defer" in PageRenderer.php added