From ab4613d9ce575174fea8f4589d2276ddc69457b1 Mon Sep 17 00:00:00 2001
From: Susanne Moog <look@susi.dev>
Date: Sun, 29 Mar 2020 13:28:27 +0200
Subject: [PATCH] [BUGFIX] Allow setting standalone modules as start module

Resolves: #90864
Releases: master
Change-Id: I3936c3a0c51f8bd05a6388f07240fe0e7d530779
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63997
Tested-by: Richard Haeser <richard@maxserv.com>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Richard Haeser <richard@maxserv.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
---
 .../Classes/Controller/SetupModuleController.php  | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/typo3/sysext/setup/Classes/Controller/SetupModuleController.php b/typo3/sysext/setup/Classes/Controller/SetupModuleController.php
index 46bcf8ed7ba3..c6a8eb9b4933 100644
--- a/typo3/sysext/setup/Classes/Controller/SetupModuleController.php
+++ b/typo3/sysext/setup/Classes/Controller/SetupModuleController.php
@@ -665,10 +665,19 @@ class SetupModuleController
         $loadModules->load($GLOBALS['TBE_MODULES']);
         $startModuleSelect = '<option value="">' . htmlspecialchars($this->getLanguageService()->getLL('startModule.firstInMenu')) . '</option>';
         foreach ($loadModules->modules as $mainMod => $modData) {
-            if (!empty($modData['sub']) && is_array($modData['sub'])) {
+            $hasSubmodules = !empty($modData['sub']) && is_array($modData['sub']);
+            $isStandalone = $modData['standalone'] ?? false;
+            if ($hasSubmodules || $isStandalone) {
                 $modules = '';
-                foreach ($modData['sub'] as $subData) {
-                    $modName = $subData['name'];
+                if (($hasSubmodules)) {
+                    foreach ($modData['sub'] as $subData) {
+                        $modName = $subData['name'];
+                        $modules .= '<option value="' . htmlspecialchars($modName) . '"';
+                        $modules .= $this->getBackendUser()->uc['startModule'] === $modName ? ' selected="selected"' : '';
+                        $modules .= '>' . htmlspecialchars($this->getLanguageService()->sL($loadModules->getLabelsForModule($modName)['title'])) . '</option>';
+                    }
+                } elseif ($isStandalone) {
+                    $modName = $modData['name'];
                     $modules .= '<option value="' . htmlspecialchars($modName) . '"';
                     $modules .= $this->getBackendUser()->uc['startModule'] === $modName ? ' selected="selected"' : '';
                     $modules .= '>' . htmlspecialchars($this->getLanguageService()->sL($loadModules->getLabelsForModule($modName)['title'])) . '</option>';
-- 
GitLab