Bug #46535

Image rendering of non-existing files throws exception

Added by Oliver Hader over 2 years ago. Updated over 2 years ago.

Status:Resolved Start date:2013-03-22
Priority:Should have Due date:
Assigned To:- % Done:

100%

Category:File Abstraction Layer (FAL) Spent time: -
Target version:6.0.5
TYPO3 Version:6.0 Is Regression:
PHP Version:5.3 Sprint Focus:
Complexity:

Description

Rendering an image that has no accordant file in a storage in the frontend (e.g. in TypoScript) fails with an exception like "Object with identifier xyz does not exist in storage" (1329647780).

Sure, the file does not exist in that case, but throwing an exception that is not caught is too much.
Besides that $cObj->getImgResource() already catches \TYPO3\CMS\Core\Resource\Exception - which does not cover RuntimeExceptions.

Solution:
Throw a \TYPO3\CMS\Core\Resource\Exception instead of a RuntimeException in these cases. A new ResourceDoesNotExistException is introduced to cover files and folders.


Related issues

related to Core - Bug #37409: Page Module unuseable if resource is missing due to excep... Closed 2012-05-23
duplicates Core - Bug #45779: Blank page/Exception when referenced images are deleted i... Accepted 2013-02-23

Associated revisions

Revision 1e1c26a7
Added by Oliver Hader over 2 years ago

[BUGFIX] Image rendering of non-existing files throws exception

Rendering an image that has no accordant file in a storage in
the frontend (e.g. in TypoScript) fails with an exception like
"Object with identifier xyz does not exist in storage".

A new ResourceDoesNotExistException is introduced to cover
files and folders and is thrown instead of RuntimeException.
This way, the exception is caught in the ContentObjectRenderer
and the frontend rendering just does not output the error,
which is logged instead.

Change-Id: I0affa15a8f0a50bf30a7176972994f209d18daf4
Fixes: #46535
Releases: 6.0, 6.1
Reviewed-on: https://review.typo3.org/19168
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader

Revision dddf13d4
Added by Oliver Hader over 2 years ago

[BUGFIX] Image rendering of non-existing files throws exception

Rendering an image that has no accordant file in a storage in
the frontend (e.g. in TypoScript) fails with an exception like
"Object with identifier xyz does not exist in storage".

A new ResourceDoesNotExistException is introduced to cover
files and folders and is thrown instead of RuntimeException.
This way, the exception is caught in the ContentObjectRenderer
and the frontend rendering just does not output the error,
which is logged instead.

Change-Id: I0affa15a8f0a50bf30a7176972994f209d18daf4
Fixes: #46535
Releases: 6.0, 6.1
Reviewed-on: https://review.typo3.org/19393
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader

History

#1 Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19168

#2 Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19168

#3 Updated by Gerrit Code Review over 2 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/19393

#4 Updated by Oliver Hader over 2 years ago

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

Also available in: Atom PDF