diff --git a/core/modules/system/src/Controller/DbUpdateController.php b/core/modules/system/src/Controller/DbUpdateController.php index 56c0bc0..c2e195e 100644 --- a/core/modules/system/src/Controller/DbUpdateController.php +++ b/core/modules/system/src/Controller/DbUpdateController.php @@ -545,11 +545,11 @@ protected function updateTasksList($active = NULL) { */ protected function triggerBatch(Request $request) { $maintenance_mode = $this->state->get('system.maintenance_mode', FALSE); - // Store the prior value in the session so it can be restored at the end - // of the batch. + // Store the current maintenance mode status in the session so that it can + // be restored at the end of the batch. $_SESSION['maintenance_mode'] = $maintenance_mode; - // During the update, always bring the site offline so that schema changes - // do not affect visiting users. + // During the update, always put the site into maintenance mode so that + // in-progress schema changes do not affect visiting users. if (empty($maintenance_mode)) { $this->state->set('system.maintenance_mode', TRUE); } diff --git a/core/modules/system/src/Tests/System/SiteMaintenanceTest.php b/core/modules/system/src/Tests/System/SiteMaintenanceTest.php index 43c8d69..54ab8b7 100644 --- a/core/modules/system/src/Tests/System/SiteMaintenanceTest.php +++ b/core/modules/system/src/Tests/System/SiteMaintenanceTest.php @@ -45,7 +45,7 @@ protected function setUp() { */ protected function testSiteMaintenance() { $this->drupalGet(Url::fromRoute('user.page')); - // JS Should be aggregated, so drupal.js is not in the page source. + // JS should be aggregated, so drupal.js is not in the page source. $links = $this->xpath('//script[contains(@src, :href)]', array(':href' => '/core/misc/drupal.js')); $this->assertFalse(isset($links[0]), 'script /core/misc/drupal.js not in page'); // Turn on maintenance mode. @@ -59,7 +59,7 @@ protected function testSiteMaintenance() { $offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => $this->config('system.site')->get('name'))); $this->drupalGet(Url::fromRoute('user.page')); - // JS Should not be aggregated, so drupal.js is in the page source. + // JS should not be aggregated, so drupal.js is expected in the page source. $links = $this->xpath('//script[contains(@src, :href)]', array(':href' => '/core/misc/drupal.js')); $this->assertTrue(isset($links[0]), 'script /core/misc/drupal.js in page'); $this->assertRaw($admin_message, 'Found the site maintenance mode message.'); diff --git a/core/modules/system/src/Tests/Update/UpdateScriptTest.php b/core/modules/system/src/Tests/Update/UpdateScriptTest.php index 589cd2d..d3e9d5e 100644 --- a/core/modules/system/src/Tests/Update/UpdateScriptTest.php +++ b/core/modules/system/src/Tests/Update/UpdateScriptTest.php @@ -202,6 +202,7 @@ function testSuccessfulUpdateFunctionality() { $this->clickLink('Administration pages'); $this->assertResponse(200); } + /** * Tests update.php while in maintenance mode. */