Commit 937575eb authored by webchick's avatar webchick

#976328 by bfroehle, dww: Fixed Update manager should not take you out of...

#976328 by bfroehle, dww: Fixed Update manager should not take you out of maintenance mode unless you asked it to
parent 81f6ecd3
......@@ -182,7 +182,8 @@ function update_authorize_update_batch_finished($success, $results) {
// update data and recompute our status, so prevent show bogus results.
_update_authorize_clear_update_status();
if ($offline) {
// Take the site out of maintenance mode if it was previously that way.
if ($offline && isset($_SESSION['maintenance_mode']) && $_SESSION['maintenance_mode'] == FALSE) {
variable_set('maintenance_mode', FALSE);
$page_message = array(
'message' => t('Update was completed successfully. Your site has been taken out of maintenance mode.'),
......@@ -213,6 +214,9 @@ function update_authorize_update_batch_finished($success, $results) {
$results['tasks'][] = t('Your modules have been downloaded and updated.');
$results['tasks'][] = t('<a href="@update">Run database updates</a>', array('@update' => base_path() . 'update.php'));
// Unset the variable since it is no longer needed.
unset($_SESSION['maintenance_mode']);
// Set all these values into the SESSION so authorize.php can display them.
$_SESSION['authorize_results']['success'] = $success;
$_SESSION['authorize_results']['page_message'] = $page_message;
......@@ -235,18 +239,21 @@ function update_authorize_install_batch_finished($success, $results) {
}
}
$offline = variable_get('maintenance_mode', FALSE);
if ($success && $offline) {
variable_set('maintenance_mode', FALSE);
$page_message = array(
'message' => t('Installation was completed successfully. Your site has been taken out of maintenance mode.'),
'type' => 'status',
);
}
elseif ($success && !$offline) {
$page_message = array(
'message' => t('Installation was completed successfully.'),
'type' => 'status',
);
if ($success) {
// Take the site out of maintenance mode if it was previously that way.
if ($offline && isset($_SESSION['maintenance_mode']) && $_SESSION['maintenance_mode'] == FALSE) {
variable_set('maintenance_mode', FALSE);
$page_message = array(
'message' => t('Installation was completed successfully. Your site has been taken out of maintenance mode.'),
'type' => 'status',
);
}
else {
$page_message = array(
'message' => t('Installation was completed successfully.'),
'type' => 'status',
);
}
}
elseif (!$success && !$offline) {
$page_message = array(
......@@ -261,6 +268,9 @@ function update_authorize_install_batch_finished($success, $results) {
);
}
// Unset the variable since it is no longer needed.
unset($_SESSION['maintenance_mode']);
// Set all these values into the SESSION so authorize.php can display them.
$_SESSION['authorize_results']['success'] = $success;
$_SESSION['authorize_results']['page_message'] = $page_message;
......
......@@ -397,6 +397,8 @@ function update_manager_update_ready_form($form, &$form_state) {
* @see system_authorized_get_url()
*/
function update_manager_update_ready_form_submit($form, &$form_state) {
// Store maintenance_mode setting so we can restore it when done.
$_SESSION['maintenance_mode'] = variable_get('maintenance_mode', FALSE);
if ($form_state['values']['maintenance_mode'] == TRUE) {
variable_set('maintenance_mode', TRUE);
}
......
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