[BUGFIX] Respect default label in TranslateViewHelper again 73/53473/2
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:47:35 +0000 (15:47 +0200)
Resolves: #81862
Related: #81168
Releases: master, 8.7
Change-Id: Iee90dd123da8f445544e06ce9b61a83be2ff662b
Reviewed-on: https://review.typo3.org/53473
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/fluid/Classes/ViewHelpers/TranslateViewHelper.php

index bb86e38..8087c08 100644 (file)
@@ -135,7 +135,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)) {