Commit 89ce95af authored by webchick's avatar webchick

Issue #2547667 by stefan.r, David_Rothstein, joelpittet: Fix broken page title...

Issue #2547667 by stefan.r, David_Rothstein, joelpittet: Fix broken page title Update Manager (authorize.php)
parent 8c6c6521
......@@ -242,6 +242,9 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
// 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());
}
......
......@@ -166,6 +166,9 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
// 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());
}
......
......@@ -72,6 +72,7 @@ public function testUploadModule() {
$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')));
......
......@@ -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');
}
/**
......
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