summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/includes/install.core.inc6
-rw-r--r--core/includes/install.inc2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php4
3 files changed, 10 insertions, 2 deletions
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index c27f75e..d71e0c8 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -160,7 +160,11 @@ function install_drupal($class_loader, $settings = []) {
}
elseif ($state['installation_finished']) {
// Redirect to the newly installed site.
- install_goto('');
+ $finish_url = '';
+ if (isset($install_state['profile_info']['distribution']['install']['finish_url'])) {
+ $finish_url = $install_state['profile_info']['distribution']['install']['finish_url'];
+ }
+ install_goto($finish_url);
}
}
}
diff --git a/core/includes/install.inc b/core/includes/install.inc
index 399476f..2a726bd 100644
--- a/core/includes/install.inc
+++ b/core/includes/install.inc
@@ -1056,6 +1056,8 @@ function drupal_check_module($module) {
* - install: Optional parameters to override the installer:
* - theme: The machine name of a theme to use in the installer instead of
* Drupal's default installer theme.
+ * - finish_url: A destination to visit after the installation of the
+ * distribution is finished
*
* Note that this function does an expensive file system scan to get info file
* information for dependencies. If you only need information from the info
diff --git a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php
index 7306e97..1e43929 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php
@@ -29,6 +29,7 @@ class DistributionProfileTest extends InstallerTestBase {
'name' => 'My Distribution',
'install' => [
'theme' => 'bartik',
+ 'finish_url' => '/myrootuser',
],
],
];
@@ -36,6 +37,7 @@ class DistributionProfileTest extends InstallerTestBase {
$path = $this->siteDirectory . '/profiles/mydistro';
mkdir($path, 0777, TRUE);
file_put_contents("$path/mydistro.info.yml", Yaml::encode($this->info));
+ file_put_contents("$path/mydistro.install", "<?php function mydistro_install() {\Drupal::service('path.alias_storage')->save('/user/1', '/myrootuser');}");
}
/**
@@ -65,7 +67,7 @@ class DistributionProfileTest extends InstallerTestBase {
* Confirms that the installation succeeded.
*/
public function testInstalled() {
- $this->assertUrl('user/1');
+ $this->assertUrl('myrootuser');
$this->assertResponse(200);
// Confirm that we are logged-in after installation.
$this->assertText($this->rootUser->getUsername());