[BUGFIX] Link to not-existing folder results in fatal error 26/20926/2
authorPhilipp Gampe <philipp.gampe@typo3.org>
Fri, 5 Apr 2013 08:05:06 +0000 (10:05 +0200)
committerPhilipp Gampe <philipp.gampe@typo3.org>
Sat, 25 May 2013 15:45:20 +0000 (17:45 +0200)
If a folder is removed from the (default) local storage outside of
TYPO3 while still being linked inside a content element, a fatal error
is thrown.

Catch the fatal error and do not render the link.
Rendering the link text, but no link is the default normal behavior of
links in frontent.

Fixes: #48390
Releases: 6.2, 6.1, 6.0
Change-Id: I7ffbf2e055a3cb204dbe61e145ca54ee18b4982b
Reviewed-on: https://review.typo3.org/20926
Reviewed-by: Dmitry Dulepov
Tested-by: Dmitry Dulepov
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index 1229a5b..de341f5 100644 (file)
@@ -5640,6 +5640,9 @@ class ContentObjectRenderer {
                                } catch (\RuntimeException $e) {
                                        // Element wasn't found
                                        $link_paramA[0] = NULL;
+                               } catch (\TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException $e) {
+                                       // Resource was not found
+                                       return $linktxt;
                                }
                        }
                        // Link parameter value