Project

General

Profile

Actions

Bug #90539

closed

TypeError in new AssetCollection related ViewHelpers

Added by Oliver Bartsch over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Category:
Fluid
Target version:
-
Start date:
2020-02-26
Due date:
% Done:

100%

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

Description

The ViewHelpers TYPO3\CMS\Fluid\ViewHelpers\Asset\CssViewHelper and TYPO3\CMS\Fluid\ViewHelpers\Asset\ScriptViewHelper are throwing a TypeError if they have an empty body and not provide a source file (href / src).

Argument 2 passed to TYPO3\CMS\Core\Page\AssetCollector::addInlineStyleSheet() must be of the type string, null given, called in /var/www/html/typo3/sysext/fluid/Classes/ViewHelpers/Asset/CssViewHelper.php on line 97

respectively

Argument 2 passed to TYPO3\CMS\Core\Page\AssetCollector::addInlineJavaScript() must be of the type string, null given, called in /var/www/html/typo3/sysext/fluid/Classes/ViewHelpers/Asset/ScriptViewHelper.php on line 93

Surely this is a mistake made in the template but this leads to an unnecessary error which could easily be prevented.

Either by using null coalescing to set an empty string in case of null or better just add a condition to check for $this->renderChildren() and not call the addInline*() function at all in this case.

Actions #1

Updated by Gerrit Code Review over 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63437

Actions #2

Updated by Gerrit Code Review over 4 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63437

Actions #3

Updated by Gerrit Code Review over 4 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63437

Actions #4

Updated by Oliver Bartsch over 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #5

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF