Project

General

Profile

Actions

Bug #95618

closed

Undefined array key warning in PageRenderer - FE exception

Added by mark roemermann about 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2021-10-13
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

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 = '&lt;script src=&quot;&#039; . htmlspecialchars($properties[&#039;file&#039;]) . &#039;&quot;&#039; . $type . $async . $defer . $integrity . $crossorigin

Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #95654: Error with concatenateJs : PHP Warning: Undefined array key "defer" in PageRenderer.phpClosed2021-10-14

Actions
Actions #1

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>';

Actions #2

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

Actions #3

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

Actions #4

Updated by Oliver Bartsch about 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #5

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
Actions #6

Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF