[BUGFIX] Respect default label in TranslateViewHelper again 67/53467/3
authorDaniel Goerz <dlg@lightwerk.com>
Thu, 13 Jul 2017 20:54:40 +0000 (22:54 +0200)
committerAndreas Fernandez <typo3@scripting-base.de>
Fri, 14 Jul 2017 13:35:24 +0000 (15:35 +0200)
Resolves: #81862
Related: #81168
Releases: master, 8.7
Change-Id: Iee90dd123da8f445544e06ce9b61a83be2ff662b
Reviewed-on: https://review.typo3.org/53467
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/fluid/Classes/ViewHelpers/TranslateViewHelper.php

index 3046929..ea2d9c4 100644 (file)
@@ -124,7 +124,11 @@ class TranslateViewHelper extends AbstractViewHelper
 
         $request = $renderingContext->getControllerContext()->getRequest();
         $extensionName = $extensionName === null ? $request->getControllerExtensionName() : $extensionName;
-        $value = static::translate($id, $extensionName, $arguments);
+        try {
+            $value = static::translate($id, $extensionName, $arguments);
+        } catch (\InvalidArgumentException $e) {
+            $value = null;
+        }
         if ($value === null) {
             $value = $default !== null ? $default : $renderChildrenClosure();
             if (!empty($arguments)) {