Project

General

Profile

Actions

Bug #100132

closed

AssetCollector TypeError

Added by Patrick Lenk over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Frontend
Start date:
2023-03-09
Due date:
% Done:

100%

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

Description

The asset collector throws an type error if the image file is not available. (TYPO3 11.5.24)
E.g. an typoscript IMAGE object rendered in fluid template with <f:cObject typoscriptObjectPath=" viewhelper, but the image file is not available.
In TYPO3 10.4 there is no type error if the image file is missing.

typo3-warning.log

[CRITICAL] request="3d3b3dc30384a" component="TYPO3.CMS.Core.Error.DebugExceptionHandler": Core: Exception handler (WEB: FE): TypeError, code #0, file /var/www/html/private/typo3/sysext/core/Classes/Page/AssetCollector.php, line 159: Argument 1 passed to TYPO3\CMS\Core\Page\AssetCollector::addMedia() must be of the type string, null given, called in /var/www/html/private/typo3/sysext/frontend/Classes/ContentObject/ImageContentObject.php on line 74- TypeError: Argument 1 passed to TYPO3\CMS\Core\Page\AssetCollector::addMedia() must be of the type string, null given, called in /var/www/html/private/typo3/sysext/frontend/Classes/ContentObject/ImageContentObject.php on line 74, in file /var/www/html/private/typo3/sysext/core/Classes/Page/AssetCollector.php:159 - {"mode":"WEB","application_mode":"FE","exception_class":"TypeError","exception_code":0,"file":"/var/www/html/private/typo3/sysext/core/Classes/Page/AssetCollector.php","line":159,"message":"Argument 1 passed to TYPO3\\CMS\\Core\\Page\\AssetCollector::addMedia() must be of the type string, null given, called in /var/www/html/private/typo3/sysext/frontend/Classes/ContentObject/ImageContentObject.php on line 74","request_url":"https://www.mysite.com/form/confirmation/Form/?cHash=f20d86a854e6e7a76af764f5de867d63","exception":"TypeError: Argument 1 passed to TYPO3\\CMS\\Core\\Page\\AssetCollector::addMedia() must be of the type string, null given, called in /var/www/html/private/typo3/sysext/frontend/Classes/ContentObject/ImageContentObject.php on line 74 and defined in /var/www/html/private/typo3/sysext/core/Classes/Page/AssetCollector.php:159\nStack trace:\n#0 /var/www/html/private/typo3/sysext/frontend/Classes/ContentObject/ImageContentObject.php(74): TYPO3\\CMS\\Core\\Page\\AssetCollector->addMedia(NULL, Array)\n#1 /var/www/html/private/typo3/sysext/frontend/Classes/ContentObject/ImageContentObject.php(41): TYPO3\\CMS\\Frontend\\ContentObject\\ImageContentObject->cImage('', Array)\n#2 /var/www/html/private/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php(801): TYPO3\\CMS\\Frontend\\ContentObject\\ImageContentObject->render(Array)\n#3 /var/www/html/private/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php(737): TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer->render(Object(TYPO3\\CMS\\Frontend\\ContentObject\\ImageContentObject), Array)\n#4 /var/www/html/private/typo3/sysext/frontend/Classes/ContentObject/FilesContentObject.php(68): TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer->cObjGetSingle('IMAGE', Array, 'renderObj')\n#5 /var/www/html/private/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php(801): TYPO3\\CMS\\Frontend\\ContentObject\\FilesContentObject->render(Array)\n#6 /var/www/html/private/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php(737): TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer->render(Object(TYPO3\\CMS\\Frontend\\ContentObject\\FilesContentObject), Array)\n#7 /var/www/html/private/typo3/sysext/frontend/Classes/ContentObject/ContentContentObject.php(96): TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer->cObjGetSingle('FILES', Array, 'renderObj')\n#8 /var/www/html/private/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php(801): TYPO3\\CMS\\Frontend\\ContentObject\\ContentContentObject->render(Array)\n#9 /var/www/html/private/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php(737): TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer->render(Object(TYPO3\\CMS\\Frontend\\ContentObject\\ContentContentObject), Array)\n#10 /var/www/html/private/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php(699): TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer->cObjGetSingle('CONTENT', Array, '2')\n#11 /var/www/html/private/typo3/sysext/frontend/Classes/ContentObject/ContentObjectArrayContentObject.php(43): TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer->cObjGet(Array)\n#12 /var/www/html/private/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php(801): TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectArrayContentObject->render(Array)\n#13 /var/www/html/private/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php(737): TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer->render(Object(TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectArrayContentObject), Array)\n#14 /var/www/html/private/typo3/sysext/fluid/Classes/ViewHelpers/CObjectViewHelper.php(197): TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer->cObjGetSingle('COA', Array, 'lib.imageWithEm...')\n#15 /var/www ...

Actions #1

Updated by Thomas Hohn over 1 year ago

  • Assignee set to Thomas Hohn
  • Target version set to Candidate for patchlevel
Actions #2

Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

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

Actions #3

Updated by Gerrit Code Review over 1 year ago

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

Actions #4

Updated by Gerrit Code Review over 1 year ago

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

Actions #5

Updated by Thomas Hohn over 1 year ago

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

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF