Bug #32528
imageViewHelper should not throw exception
Status: | Resolved | Start date: | 2011-12-14 | |
---|---|---|---|---|
Priority: | Must have | Due date: | ||
Assigned To: | - | % Done: | 100% |
|
Category: | Fluid | Spent time: | - | |
Target version: | - | |||
TYPO3 Version: | 6.2 | Is Regression: | No | |
PHP Version: | Sprint Focus: | |||
Complexity: |
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
Related issues
Associated revisions
[BUGFIX] ViewHelper Exceptions are logged in Production
In Production context all Exceptions from ViewHelpers
will be silently logged.
Additionally, the output is discarded from rendering.
In Development they will be re-thrown, so the
global exception handler will be triggered.
Resolves: #32528
Releases: master
Change-Id: I4af4d03ff6048fcc8999f4a48d5c2897dc43fc4e
Reviewed-on: http://review.typo3.org/40212
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Peter Niederlag <peter.niederlag@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
History
#1 Updated by Anja Leichsenring over 2 years ago
- Project changed from Extbase MVC Framework to Fluid
- Category changed from 963 to Fluid: ViewHelpers
#2 Updated by Alexander Opitz 11 months ago
- Status changed from New to Needs Feedback
Hi,
was this issue fixed or does it still exists?
#3 Updated by Riccardo De Contardi 9 months ago
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.
#4 Updated by Alexander Opitz 9 months ago
- Project changed from Fluid to Core
- Category changed from Fluid: ViewHelpers to Fluid
- TYPO3 Version set to 6.2
- Is Regression set to No
#5 Updated by Alexander Opitz 8 months ago
- Status changed from Needs Feedback to New
#6 Updated by Christian Weiske 5 months ago
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
#7 Updated by Michael Münch 5 months ago
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.
#8 Updated by Gerrit Code Review about 1 month ago
- 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
#9 Updated by Gerrit Code Review about 1 month ago
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
#10 Updated by Gerrit Code Review about 1 month ago
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
#11 Updated by Gerrit Code Review about 1 month ago
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
#12 Updated by Helmut Hummel about 1 month ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset a3e48b1b368db95df08f852c17f928184da83724.