#98958TYPO3 11 and PHP 8.1 YouTubeRenderer Undefined array key "controls"
Description
I tried to use a YouTube Video via the sys_file_reference (TCA) and i got the following error:
PHP Warning: Undefined array key "controls" in /myPath/typo3/sysext/core/Classes/Resource/Rendering/YouTubeRenderer.php line 142
This comes from this snippet:
protected function createYouTubeUrl(array $options, FileInterface $file)
{
$videoId = $this->getVideoIdFromFile($file);
$urlParams = ['autohide=1'];
$urlParams[] = 'controls=' . $options['controls'];
...
}
The solution could be:
$urlParams = ['autohide=1'];
if (isset($options['controls'])) {
$urlParams[] = 'controls=' . $options['controls'];
}
*System*
TYPO3: 11
PHP: 8.1
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Files 1
History 3
-
Chris Müller commented and changed attached clipboard-202210311024-nyug2.png 10/31/22, 09:25
-
Chris Müller commented 10/31/22, 12:40
See also here: https://github.com/TYPO3-Headless/headless/issues/502
-
Stefan Bürk commented and changed status
NewClosed 11/08/22, 12:54Closing this issue, as this is not a issue of the core.
Discussion on Slack about this topic:
clipboard-202210311024-nyug2.png