Issue Bug Closed

#98958TYPO3 11 and PHP 8.1 YouTubeRenderer Undefined array key "controls"

Aristeidis Karavas 10/31/22, 08:35 updated 11/08/22, 12:54

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

  1. Chris Müller commented and changed attached clipboard-202210311024-nyug2.png 10/31/22, 09:25

    Discussion on Slack about this topic:

    clipboard-202210311024-nyug2.png

  2. Stefan Bürk commented and changed status New Closed 11/08/22, 12:54

    Closing this issue, as this is not a issue of the core.