Skip to content

Commit

Permalink
[TASK] Allow overriding current site url during installation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
helhum authored and bmack committed Apr 28, 2020
1 parent 3c6d295 commit b5143ab
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -1360,8 +1360,14 @@ protected function createSiteConfiguration(string $identifier, int $rootPageId,
if (!($normalizedParams instanceof NormalizedParams)) {
$normalizedParams = NormalizedParams::createFromRequest($request);
}
// Check for siteUrl, despite there currently is no UI to provide it,
// to allow TYPO3 Console (for TYPO3 v10) to set this value to something reasonable,
// because on cli there is no way to find out which hostname the site is supposed to have.
// In the future this controller should be refactored to a generic service, where site URL is
// just one input argument.
$siteUrl = $request->getParsedBody()['install']['values']['siteUrl'] ?? $normalizedParams->getSiteUrl();

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

0 comments on commit b5143ab

Please sign in to comment.