You are here

function _redirect_migrate_finished_callback in Redirect 7.2

Same name and namespace in other branches
  1. 7 redirect.install \_redirect_migrate_finished_callback()

Set an appropriate message when the batch migration is complete.

1 string reference to '_redirect_migrate_finished_callback'
redirect_install in ./redirect.install
Implements hook_install().

File

./redirect.install, line 416
Install, update and uninstall functions for the redirect module.

Code

function _redirect_migrate_finished_callback($success, $results, $operations) {
  if ($success) {

    // Show a message about how many redirects were migrated, and how many
    // were skipped.
    $message = t('Migrated !migrated redirects.', array(
      '!migrated' => $results['migrated'],
    ));
    if (!empty($results['skipped'])) {
      $message .= ' ' . t('The following !skipped redirects were not migrated since there were already existing redirects for the path and language combination:', array(
        '!skipped' => $results['skipped_count'],
      ));
      $message .= theme('item_list', array(
        'items' => $results['skipped'],
      ));
    }
  }
  else {
    $message = t('There was a problem with the migration from path_redirect.');
  }
  drupal_set_message($message);
}