Skip to content
Snippets Groups Projects
Commit 338262c0 authored by Angie Byron's avatar Angie Byron
Browse files

#617588 by dww and yoroy: Drastically improve the UI for the landing page...

#617588 by dww and yoroy: Drastically improve the UI for the landing page before you actually update your site.
parent 1c2cda2d
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -27,7 +27,7 @@
* extracting the archive, and verifying the contents. If there are any
* errors, the user is redirected back to the first page with the error
* messages. If all downloads were extacted and verified, the user is instead
* redirected to admin/update/confirm, a landing page which reminds them to
* redirected to admin/update/ready, a landing page which reminds them to
* backup their database and asks if they want to put the site offline during
* the upgrade. Once the user presses the "Install updates" button, they are
* redirected to authorize.php to supply their web root file access
......@@ -332,8 +332,9 @@ function update_manager_download_batch_finished($success, $results) {
drupal_set_message(theme('item_list', $error_list), 'error');
}
elseif ($success) {
drupal_set_message(t('Updates downloaded successfully.'));
$_SESSION['update_manager_update_projects'] = $results['projects'];
drupal_goto('admin/update/confirm');
drupal_goto('admin/update/ready');
}
else {
// Ideally we're catching all Exceptions, so they should never see this,
......@@ -343,7 +344,7 @@ function update_manager_download_batch_finished($success, $results) {
}
/**
* Build the form to confirm that an update should proceed (after downloading).
* Build the form when the site is ready to update (after downloading).
*
* This form is an intermediary step in the automated update workflow. It is
* presented to the site administrator after all the required updates have
......@@ -353,41 +354,22 @@ function update_manager_download_batch_finished($success, $results) {
* After this step, the user is redirected to authorize.php to enter their
* file transfer credentials and attempt to complete the update.
*/
function update_manager_confirm_update_form($form, &$form_state) {
$form['information']['#weight'] = -100;
$form['information']['backup_header'] = array(
'#prefix' => '<h3>',
'#markup' => t('Step 1: Backup your site'),
'#suffix' => '</h3>',
);
$form['information']['backup_message'] = array(
'#prefix' => '<p>',
'#markup' => t('We do not currently have a web based backup tool. <a href="@backup_url">Learn more about how to take a backup</a>.', array('@backup_url' => url('http://drupal.org/node/22281'))),
'#suffix' => '</p>',
);
$form['information']['maint_header'] = array(
'#prefix' => '<h3>',
'#markup' => t('Step 2: Enter maintenance mode'),
'#suffix' => '</h3>',
);
$form['information']['maint_message'] = array(
'#prefix' => '<p>',
'#markup' => t('It is strongly recommended that you put your site into maintenance mode while performing an update.'),
'#suffix' => '</p>',
function update_manager_update_ready_form($form, &$form_state) {
$form['backup'] = array(
'#prefix' => '<strong>',
'#markup' => t('Back up your database and site before you continue. <a href="@backup_url">Learn how</a>.', array('@backup_url' => url('http://drupal.org/node/22281'))),
'#suffix' => '</strong>',
);
$form['information']['site_offline'] = array(
'#title' => t('Perform updates with site in maintenance mode'),
$form['site_offline'] = array(
'#title' => t('Perform updates with site in maintenance mode (strongly recommended)'),
'#type' => 'checkbox',
'#default_value' => TRUE,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Install updates'),
'#value' => t('Continue'),
'#weight' => 100,
);
......@@ -407,7 +389,7 @@ function update_manager_confirm_update_form($form, &$form_state) {
* @see system_authorized_init()
* @see system_authorized_get_url()
*/
function update_manager_confirm_update_form_submit($form, &$form_state) {
function update_manager_update_ready_form_submit($form, &$form_state) {
if ($form_state['values']['site_offline'] == TRUE) {
variable_set('site_offline', TRUE);
}
......
......@@ -103,7 +103,7 @@ function update_help($path, $arg) {
case 'admin/reports/updates/install':
case 'admin/reports/updates/settings':
case 'admin/reports/status':
case 'admin/update/confirm':
case 'admin/update/ready':
// These pages don't need additional nagging.
break;
......@@ -225,10 +225,10 @@ function update_menu() {
// Menu callback used for the confirmation page after all the releases
// have been downloaded, asking you to backup before installing updates.
$items['admin/update/confirm'] = array(
'title' => 'Confirm update',
$items['admin/update/ready'] = array(
'title' => 'Ready to update',
'page callback' => 'drupal_get_form',
'page arguments' => array('update_manager_confirm_update_form'),
'page arguments' => array('update_manager_update_ready_form'),
'access callback' => 'update_manager_access',
'access arguments' => array(),
'type' => MENU_CALLBACK,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment