Issue #2547667 by stefan.r, David_Rothstein, joelpittet: Fix broken page title Update Manager (authorize.php)

8.0.x
webchick 2015-08-28 23:46:46 -07:00
parent 8c6c652107
commit 89ce95af12
4 changed files with 19 additions and 2 deletions

View File

@ -242,6 +242,9 @@ class UpdateManagerInstall extends FormBase {
// credentials and invoke update_authorize_run_install() indirectly with
// whatever FileTransfer object authorize.php creates for us.
else {
// The page title must be passed here to ensure it is initially used when
// authorize.php loads for the first time with the FTP/SSH credentials
// form.
system_authorized_init('update_authorize_run_install', drupal_get_path('module', 'update') . '/update.authorize.inc', $arguments, $this->t('Update manager'));
$form_state->setRedirectUrl(system_authorized_get_url());
}

View File

@ -166,6 +166,9 @@ class UpdateReady extends FormBase {
// credentials and invoke update_authorize_run_update() indirectly with
// whatever FileTransfer object authorize.php creates for us.
else {
// The page title must be passed here to ensure it is initially used
// when authorize.php loads for the first time with the FTP/SSH
// credentials form.
system_authorized_init('update_authorize_run_update', drupal_get_path('module', 'update') . '/update.authorize.inc', array($updates), $this->t('Update manager'));
$form_state->setRedirectUrl(system_authorized_get_url());
}

View File

@ -72,6 +72,7 @@ class UpdateUploadTest extends UpdateTestBase {
$this->drupalPostForm('admin/modules/install', $edit, t('Install'));
// Check that submitting the form takes the user to authorize.php.
$this->assertUrl('core/authorize.php');
$this->assertTitle('Update manager | Drupal');
// Check for a success message on the page, and check that the installed
// module now exists in the expected place in the filesystem.
$this->assertRaw(t('Installed %project_name successfully', array('%project_name' => 'update_test_new_module')));

View File

@ -50,7 +50,6 @@ function update_authorize_run_update($filetransfer, $projects) {
}
$batch = array(
'title' => t('Installing updates'),
'init_message' => t('Preparing to update your site'),
'operations' => $operations,
'finished' => 'update_authorize_update_batch_finished',
@ -58,6 +57,11 @@ function update_authorize_run_update($filetransfer, $projects) {
);
batch_set($batch);
// Since authorize.php has its own method for setting the page title, set it
// manually here rather than passing it in to batch_set() as would normally
// be done.
$_SESSION['authorize_page_title'] = t('Installing updates');
// Invoke the batch via authorize.php.
return system_authorized_batch_process();
}
@ -99,7 +103,6 @@ function update_authorize_run_install($filetransfer, $project, $updater_name, $l
// @todo Instantiate our Updater to set the human-readable title?
$batch = array(
'title' => t('Installing %project', array('%project' => $project)),
'init_message' => t('Preparing to install'),
'operations' => $operations,
// @todo Use a different finished callback for different messages?
@ -108,6 +111,11 @@ function update_authorize_run_install($filetransfer, $project, $updater_name, $l
);
batch_set($batch);
// Since authorize.php has its own method for setting the page title, set it
// manually here rather than passing it in to batch_set() as would normally
// be done.
$_SESSION['authorize_page_title'] = t('Installing %project', array('%project' => $project));
// Invoke the batch via authorize.php.
return system_authorized_batch_process();
}
@ -262,6 +270,7 @@ function update_authorize_update_batch_finished($success, $results) {
$_SESSION['authorize_results']['page_message'] = $page_message;
$_SESSION['authorize_results']['messages'] = $results['log'];
$_SESSION['authorize_results']['tasks'] = $results['tasks'];
$_SESSION['authorize_page_title'] = t('Update manager');
}
/**
@ -322,6 +331,7 @@ function update_authorize_install_batch_finished($success, $results) {
$_SESSION['authorize_results']['page_message'] = $page_message;
$_SESSION['authorize_results']['messages'] = $results['log'];
$_SESSION['authorize_results']['tasks'] = $results['tasks'];
$_SESSION['authorize_page_title'] = t('Update manager');
}
/**