Project

General

Profile

Actions

Bug #98958

closed

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

Added by Aristeidis Karavas about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
Start date:
2022-10-31
Due date:
% Done:

0%

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

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


Files

clipboard-202210311024-nyug2.png (98.3 KB) clipboard-202210311024-nyug2.png Chris Müller, 2022-10-31 09:24
Actions #1

Updated by Chris Müller about 2 years ago

Discussion on Slack about this topic:

Actions #3

Updated by Stefan Bürk about 2 years ago

  • Status changed from New to Closed

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

Actions

Also available in: Atom PDF