[BUGFIX] Tx_Extbase_Utility_Localization::translate() must return NULL for non-existi...
authorBastian Waidelich <bastian@typo3.org>
Fri, 9 Sep 2011 14:57:34 +0000 (16:57 +0200)
committerBastian Waidelich <bastian@typo3.org>
Fri, 9 Sep 2011 14:57:34 +0000 (16:57 +0200)
Apparently the behavior of t3lib_fe->sL() changed resulting in
Tx_Extbase_Utility_Localization::translate() returning FALSE if
the given locallang key does not exist.
The translation ViewHelper of Fluid however expects NULL to be
returned in that case.

Change-Id: Id816d2e9e586ceaf663c123018996e53103ee70b

typo3/sysext/extbase/Classes/Utility/Localization.php

index 0922169..4d1b9cd 100644 (file)
@@ -135,7 +135,8 @@ class Tx_Extbase_Utility_Localization {
         */
        protected function translateFileReference($key) {
                if (TYPO3_MODE === 'FE') {
-                       return $GLOBALS['TSFE']->sL($key);
+                       $value = $GLOBALS['TSFE']->sL($key);
+                       return $value !== FALSE ? $value : NULL;
                } elseif (is_object($GLOBALS['LANG'])) {
                        $value = $GLOBALS['LANG']->sL($key);
                        return $value !== '' ? $value : NULL;