Bug #32528
closed
imageViewHelper should not throw exception
Added by Peter Niederlag almost 13 years ago.
Updated about 6 years ago.
Description
Hey guys,
we don't like the imageViewHelper to throw exceptions if an image is not found. it should behave like the underlying cObj::getImgResource() and just don't do anything.
regards, foertel, pniederlag
- Project changed from 534 to 2559
- Category changed from 963 to Fluid: ViewHelpers
- Status changed from New to Needs Feedback
Hi,
was this issue fixed or does it still exists?
It still exists in TYPO3 6.2.6
Test:
1. upload the image 539.png into /fileadmin/Images/
2. add somewhere in the page template /partial: <f:image src="fileadmin/Images/539.png" />
3. the image is shown
4. delete the image
5. refresh page - the following error is shown:
Oops, an error occurred!
File /Images/539.png/ does not exist.
More information regarding this error might be available online.
- Project changed from 2559 to TYPO3 Core
- Category changed from Fluid: ViewHelpers to Fluid
- TYPO3 Version set to 6.2
- Is Regression set to No
- Status changed from Needs Feedback to New
If someone implements this, it would be nice to have the option what to do when the image cannot be found:
- Output no image tag
- Output an image tag with a "broken" image whose path can be customized, maybe via an attribute
- Throw exception
The Viewhelper should never throw any exceptions for invalid or non existing files cause this is not an breaking error which could result in invalid code execution.
Instead log the error to the system log and just output an empty string or dummy image so developers can track the error and customers / users can use the page as it is instead of seeing an "Oops an error occured".
While exceptions are fine during development and to protect pieces of the core from running into undefined states - they are not meant to be used as simple hints to the end user of the website.
If someone can link me some instructions on how to create an patch - i'll try to share our "Bugfix" which we added to our core which simply adds an try / catch Block around some pieces und catch the exception for further processing.
- Status changed from New to Under Review
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40212
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40212
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40212
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40212
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Hey guys,
this is still not implemented in TYPO3 6.2.16, would it be possible to include this in the next 6.2.17?
- Status changed from Resolved to Closed
Also available in: Atom
PDF