Project

General

Profile

Actions

Bug #95714

open

Omit attributes with blank values for additionalAttributes in VideoTagRenderer

Added by Christian Toffolo over 2 years ago. Updated over 2 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2021-10-20
Due date:
% Done:

0%

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

Description

VideoTagRenderer.php implodes attributes with $dontOmitBlankAttribs = true.

$attributes[] = GeneralUtility::implodeAttributes($options['additionalAttributes'], true, true);

This could create problems like in this use case:

Example:

<f:media ... additionalAttributes="{poster: '{v:media.exists(file: \'fileadmin/test.jpg\', then: \'/fileadmin/test.jpg\')}', no-cookie: 1, relatedVideos: 0, color: 'white', playsinline: '1'}" />

In this case, AFAIK, it's not possible to omit the attribute 'poster' in Fluid. So, if file doesn't exist the attribute will still be present with an empty value but the use case wants that if a poster is not available for the video then the attribute must not be present.

I don't know if there are use cases that needs $dontOmitBlankAttribs = true but I think that it should be false.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #81741: MediaViewHelper does not pass additionalAttributes and data to renderer instanceClosed2017-06-29

Actions
Actions #1

Updated by Oliver Hader over 2 years ago

Introduced with https://review.typo3.org/c/Packages/TYPO3.CMS/+/53488/, issue #81741
(it probably affects some more classes, not only VideoTagRenderer)

Actions #2

Updated by Oliver Hader over 2 years ago

  • Related to Bug #81741: MediaViewHelper does not pass additionalAttributes and data to renderer instance added
Actions

Also available in: Atom PDF