Bug #90539
closedTypeError in new AssetCollection related ViewHelpers
100%
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.
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
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
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
Updated by Oliver Bartsch over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 6f186ff95dfc66f419cc53c78afd678ccfdf53d3.