Actions
Bug #98958
closedTYPO3 11 and PHP 8.1 YouTubeRenderer Undefined array key "controls"
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
Updated by Chris Müller about 2 years ago
Discussion on Slack about this topic:
Updated by Chris Müller about 2 years ago
See also here: https://github.com/TYPO3-Headless/headless/issues/502
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