[BUGFIX] Link to not-existing folder results in fatal error 44/21044/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:52:30 +0000 (17:52 +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/21044
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index d1bdc27..574a002 100644 (file)
@@ -5577,6 +5577,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