[TASK] Use LanguageService::$moduleLabels as fallback in ModuleLoader 32/51932/2
authorNicole Cordes <typo3@cordes.co>
Thu, 2 Mar 2017 23:18:17 +0000 (00:18 +0100)
committerMorton Jonuschat <m.jonuschat@mojocode.de>
Sat, 4 Mar 2017 02:15:30 +0000 (03:15 +0100)
As the property moduleLabels of the LanguageService was deprecated with
8, it should be used as fallback for module labels unless it is removed
completely. This raises compatibility possibilities for extensions as
otherwise an empty module is shown in the module list.

Resolves: #80107
Releases: master
Change-Id: I5fc306b2bd2c2ba221ad877cec3914f07d2ff584
Reviewed-on: https://review.typo3.org/51932
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Thomas Hohn <thomas@hohn.dk>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
typo3/sysext/backend/Classes/Module/ModuleLoader.php

index 2636685..d4109fd 100644 (file)
@@ -386,6 +386,18 @@ class ModuleLoader
                 $language = 'default';
             }
 
+            if (empty($labels)) {
+                if (isset($this->getLanguageService()->moduleLabels['labels'][$moduleName . '_tablabel'])) {
+                    $labels[$language]['labels']['tablabel'] = $this->getLanguageService()->moduleLabels['labels'][$moduleName . '_tablabel'];
+                }
+                if (isset($this->getLanguageService()->moduleLabels['labels'][$moduleName . '_tabdescr'])) {
+                    $labels[$language]['labels']['tabdescr'] = $this->getLanguageService()->moduleLabels['labels'][$moduleName . '_tabdescr'];
+                }
+                if (isset($this->getLanguageService()->moduleLabels['tabs'][$moduleName . '_tab'])) {
+                    $labels[$language]['tabs']['tab'] = $this->getLanguageService()->moduleLabels['tabs'][$moduleName . '_tab'];
+                }
+            }
+
             if (isset($labels[$language]['ll_ref'])) {
                 $this->addLabelsForModule($moduleName, $labels[$language]['ll_ref']);
             } elseif (isset($labels['default']['ll_ref'])) {