You are here

function migrate_ui_batch_finish in Migrate 7.2

Same name and namespace in other branches
  1. 6.2 migrate_ui/migrate_ui.pages.inc \migrate_ui_batch_finish()

Implements callback_batch_finished().

Report results.

Parameters

$success: Ignored

$results: List of results from batch processing

$operations: Ignored

2 string references to 'migrate_ui_batch_finish'
MigrateUIWizard::formPerformImport in migrate_ui/migrate_ui.wizard.inc
Run the import process for the migration group we've defined.
migrate_ui_migrate_submit in migrate_ui/migrate_ui.pages.inc
Submit callback for the dashboard form.

File

migrate_ui/migrate_ui.pages.inc, line 670
Pages for managing migration processes.

Code

function migrate_ui_batch_finish($success, $results, $operations) {
  unset($results['stopped']);
  foreach ($results as $result) {

    // Migration::progressMessage() uses message levels that don't match what
    // drupal_set_message() expects.
    if (isset($result['level'])) {
      if ($result['level'] == 'completed') {
        $level = 'status';
      }
      elseif ($result['level'] == 'failed') {
        $level = 'error';
      }
      else {
        $level = $result['level'];
      }
    }
    else {
      $level = NULL;
    }
    drupal_set_message($result['message'], $level);
  }
}