W3cubDocs

/Drupal 8

function update_fetch_data_finished

update_fetch_data_finished($success, $results)

Batch callback: Performs actions when all fetch tasks have been 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, including the key 'updated' which holds the total number of projects we fetched available update data for.

File

core/modules/update/update.module, line 409
Handles updates of Drupal core and contributed projects.

Code

function update_fetch_data_finished($success, $results) {
  if ($success) {
    if (!empty($results)) {
      if (!empty($results['updated'])) {
        drupal_set_message(\Drupal::translation()->formatPlural($results['updated'], 'Checked available update data for one project.', 'Checked available update data for @count projects.'));
      }
      if (!empty($results['failures'])) {
        drupal_set_message(\Drupal::translation()->formatPlural($results['failures'], 'Failed to get available update data for one project.', 'Failed to get available update data for @count projects.'), 'error');
      }
    }
  }
  else {
    drupal_set_message(t('An error occurred trying to get available update data.'), '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.module/function/update_fetch_data_finished/8.1.x