function redirect_generate_batch_finished in Redirect 8
Same name and namespace in other branches
- 7.2 redirect.generate.inc \redirect_generate_batch_finished()
- 7 redirect.generate.inc \redirect_generate_batch_finished()
1 string reference to 'redirect_generate_batch_finished'
File
- ./redirect.generate.inc, line 168 
- Generate callbacks for the redirect module.
Code
function redirect_generate_batch_finished($success, $results, $operations) {
  if ($success) {
    \Drupal::messenger()
      ->addMessage(\Drupal::translation()
      ->formatPlural(count($results), 'One URL redirect created.', '@count URL redirects created.'));
  }
  else {
    // An error occurred.
    // $operations contains the operations that remained unprocessed.
    $error_operation = reset($operations);
    \Drupal::messenger()
      ->addMessage(t('An error occurred while processing @operation with arguments : @args', [
      '@operation' => $error_operation[0],
      '@args' => print_r($error_operation[0], TRUE),
    ]));
  }
}