diff --git a/core/lib/Drupal/Core/Update/UpdateKernel.php b/core/lib/Drupal/Core/Update/UpdateKernel.php index 04c4668..1c2ca61 100755 --- a/core/lib/Drupal/Core/Update/UpdateKernel.php +++ b/core/lib/Drupal/Core/Update/UpdateKernel.php @@ -70,6 +70,7 @@ protected function initializeContainer() { $routes->add('', new Route('/', ['_title' => 'Home'], ['_access' => 'TRUE'])); $routes->add('', new Route('', [], ['_access' => 'TRUE'], ['_no_path' => TRUE])); $routes->add('', new Route('')); + $routes->add('system.site_maintenance_mode', new Route('/admin/config/development/maintenance', ['_title' => 'Maintenance mode'], ['_permission' => 'administer site configuration'])); $routes->add('system.db_update', new Route('/update.php/{op}', ['op' => 'info'], ['_access' => 'TRUE'])); $mock_route_provider = new MockRouteProvider($routes); diff --git a/core/modules/system/src/Controller/DbUpdateController.php b/core/modules/system/src/Controller/DbUpdateController.php index cde11f7..e66a1a5 100644 --- a/core/modules/system/src/Controller/DbUpdateController.php +++ b/core/modules/system/src/Controller/DbUpdateController.php @@ -210,7 +210,9 @@ protected function info(Request $request) { ); $info[] = $this->t("Back up your code. 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."); - $info[] = $this->t('Put your site into maintenance mode.'); + $info[] = $this->t('Put your site into maintenance mode.', array( + '@url' => Url::fromRoute('system.site_maintenance_mode')->toString(TRUE)->getGeneratedUrl(), + )); $info[] = $this->t('Back up your database. 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.'); $build['info'] = array( @@ -226,6 +228,7 @@ protected function info(Request $request) { '#type' => 'link', '#title' => $this->t('Continue'), '#attributes' => array('class' => array('button', 'button--primary')), + // @todo Revisit once https://www.drupal.org/node/2548095 is in. '#url' => Url::fromUri('base://selection'), ); return $build; @@ -482,7 +485,10 @@ protected function results(Request $request) { */ public function requirements($severity, array $requirements, Request $request) { $options = $severity == REQUIREMENT_WARNING ? array('continue' => 1) : array(); - $try_again_url = Url::fromUri('base://')->setOptions(['query' => $options])->toString(TRUE)->getGeneratedUrl(); + // @todo Revisit once https://www.drupal.org/node/2548095 is in. Something + // like Url::fromRoute('system.db_update')->setOptions ... should then be + // possible. + $try_again_url = Url::fromUri($request->getUriForPath(''))->setOptions(['query' => $options])->toString(TRUE)->getGeneratedUrl(); $build['status_report'] = array( '#theme' => 'status_report', @@ -578,6 +584,7 @@ protected function triggerBatch(Request $request) { ); batch_set($batch); + // @todo Revisit once https://www.drupal.org/node/2548095 is in. return batch_process(Url::fromUri('base://results'), Url::fromUri('base://start')); }