On this page
function update_manager_download_batch_finished
update_manager_download_batch_finished($success, $results)
Batch callback: Performs actions when the download batch is completed.
Parameters
$success: TRUE if the batch operation was successful, FALSE if there were errors.
$results: An associative array of results from the batch operation.
File
- core/modules/update/update.manager.inc, line 49
- Administrative screens and processing functions of the Update Manager module.
Code
function update_manager_download_batch_finished($success, $results) {
if (!empty($results['errors'])) {
$item_list = array(
'#theme' => 'item_list',
'#title' => t('Downloading updates failed:'),
'#items' => $results['errors'],
);
drupal_set_message(drupal_render($item_list), 'error');
}
elseif ($success) {
drupal_set_message(t('Updates downloaded successfully.'));
$_SESSION['update_manager_update_projects'] = $results['projects'];
return new RedirectResponse(\Drupal::url('update.confirmation_page', [], ['absolute' => TRUE]));
}
else {
// Ideally we're catching all Exceptions, so they should never see this,
// but just in case, we have to tell them something.
drupal_set_message(t('Fatal error trying to download.'), 'error');
}
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!update!update.manager.inc/function/update_manager_download_batch_finished/8.1.x