Unverified Commit 240e303d authored by alexpott's avatar alexpott
Browse files

Issue #2830326 by dww, mpdonadio, cebasqueira, Wim Leers, amateescu, jungle,...

Issue #2830326 by dww, mpdonadio, cebasqueira, Wim Leers, amateescu, jungle, xjm, daffie, Pasqualle: Broken link to 'Put your site into maintenance mode' on update.php results in WSOD
parent 7546ecb1
......@@ -216,8 +216,10 @@ protected function info(Request $request) {
$info[] = $this->t("<strong>Back up your code</strong>. Hint: when backing up module code, do not leave that backup in the 'modules' or 'sites/*/modules' directories as this may confuse Drupal's auto-discovery mechanism.");
// @todo Simplify with https://www.drupal.org/node/2548095
$base_url = str_replace('/update.php', '', $request->getBaseUrl());
$info[] = $this->t('Put your site into <a href=":url">maintenance mode</a>.', [
':url' => Url::fromRoute('system.site_maintenance_mode')->toString(TRUE)->getGeneratedUrl(),
':url' => Url::fromRoute('system.site_maintenance_mode')->setOption('base_url', $base_url)->toString(TRUE)->getGeneratedUrl(),
$info[] = $this->t('<strong>Back up your database</strong>. This process will change your database values and in case of emergency you may need to revert to a backup.');
$info[] = $this->t('Install your new files in the appropriate location, as described in the handbook.');
......@@ -641,6 +641,23 @@ public function testSuccessfulMultilingualUpdateFunctionality() {
* Tests maintenance mode link on update.php.
public function testMaintenanceModeLink() {
$admin_user = $this->drupalCreateUser([
'administer software updates',
'access administration pages',
'administer site configuration',
$this->drupalGet($this->updateUrl, ['external' => TRUE]);
$this->clickLink('maintenance mode');
$this->assertEquals('Maintenance mode', $this->cssSelect('main h1')[0]->getText());
* Helper function to run updates via the browser.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment