Skip to content

Commit b5143ab

Browse files
helhumbmack
authored andcommitted
[TASK] Allow overriding current site url during installation
Especially to ease using the API on CLI, we now add a request argument for the siteUrl which is preferred over the current site url to create a default site configuration. Resolves: #91214 Releases: master Change-Id: If00beb2550909c2334d99a61283c6d7f546b25d7 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64329 Tested-by: Benjamin Franzke <bfr@qbus.de> Tested-by: TYPO3com <noreply@typo3.com> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Benjamin Franzke <bfr@qbus.de> Reviewed-by: Benni Mack <benni@typo3.org>
1 parent 3c6d295 commit b5143ab

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

typo3/sysext/install/Classes/Controller/InstallerController.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,8 +1360,14 @@ protected function createSiteConfiguration(string $identifier, int $rootPageId,
13601360
if (!($normalizedParams instanceof NormalizedParams)) {
13611361
$normalizedParams = NormalizedParams::createFromRequest($request);
13621362
}
1363+
// Check for siteUrl, despite there currently is no UI to provide it,
1364+
// to allow TYPO3 Console (for TYPO3 v10) to set this value to something reasonable,
1365+
// because on cli there is no way to find out which hostname the site is supposed to have.
1366+
// In the future this controller should be refactored to a generic service, where site URL is
1367+
// just one input argument.
1368+
$siteUrl = $request->getParsedBody()['install']['values']['siteUrl'] ?? $normalizedParams->getSiteUrl();
13631369

13641370
// Create a default site configuration called "main" as best practice
1365-
$this->siteConfiguration->createNewBasicSite($identifier, $rootPageId, $normalizedParams->getSiteUrl());
1371+
$this->siteConfiguration->createNewBasicSite($identifier, $rootPageId, $siteUrl);
13661372
}
13671373
}

0 commit comments

Comments
 (0)