[BUGFIX] Do not show empty modules for backend users 96/38496/2
authorMichael Oehlhof <typo3@oehlhof.de>
Mon, 6 Apr 2015 13:20:03 +0000 (15:20 +0200)
committerAndreas Fernandez <andreas.fernandez@aspedia.de>
Thu, 9 Apr 2015 08:39:32 +0000 (10:39 +0200)
Do not show the module group if it does not contain any sub modules.

Resolves: #66232
Releases: master
Change-Id: I2187f6edede1a430f75f6390105947bc1b33156c
Reviewed-on: http://review.typo3.org/38496
Reviewed-by: Stefan Froemken <froemken@gmail.com>
Tested-by: Stefan Froemken <froemken@gmail.com>
Reviewed-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Tested-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
typo3/sysext/backend/Classes/Domain/Repository/Module/BackendModuleRepository.php

index 5fd3d85..30f6a6d 100644 (file)
@@ -56,7 +56,9 @@ class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface {
                $modules = new \SplObjectStorage();
                foreach ($this->moduleStorage->getEntries() as $moduleGroup) {
                        if (!in_array($moduleGroup->getName(), $excludeGroupNames, TRUE)) {
-                               $modules->attach($moduleGroup);
+                               if ($moduleGroup->getChildren()->count() > 0) {
+                                       $modules->attach($moduleGroup);
+                               }
                        }
                }