diff --git a/src/MigrateUpgradeRunBatch.php b/src/MigrateUpgradeRunBatch.php index 83f72c2..6ac6ed3 100644 --- a/src/MigrateUpgradeRunBatch.php +++ b/src/MigrateUpgradeRunBatch.php @@ -91,9 +91,7 @@ class MigrateUpgradeRunBatch { * @param $elapsed */ public static function finished($success, $results, $operations, $elapsed) { - drupal_set_message(t('Import complete.')); self::displayResults($results); - drupal_set_message(t('Congratulations, you upgraded Drupal!')); } /** @@ -103,6 +101,7 @@ class MigrateUpgradeRunBatch { */ protected static function displayResults($results) { $successes = $failures = 0; + $status_type = 'status'; foreach ($results as $result) { if ($result == 'success') { $successes++; @@ -111,18 +110,25 @@ class MigrateUpgradeRunBatch { $failures++; } } - if ($successes > 0) { + if ($successes > 0 && $failures == 0) { + drupal_set_message(t('Import complete.')); drupal_set_message(t('@count succeeded', array('@count' => \Drupal::translation()->formatPlural($successes, '1 migration', '@count migrations')))); + drupal_set_message(t('Congratulations, you upgraded Drupal!')); } if ($failures > 0) { + drupal_set_message(t('Import process not completed!'), 'error'); + drupal_set_message(t('@count succeeded', + array('@count' => \Drupal::translation()->formatPlural($successes, + '1 migration', '@count migrations'))), 'error'); drupal_set_message(t('@count failed', array('@count' => \Drupal::translation()->formatPlural($failures, - '1 migration', '@count migrations')))); + '1 migration', '@count migrations'))), 'error'); + $status_type = 'error'; } if (\Drupal::moduleHandler()->moduleExists('dblog')) { - drupal_set_message(l('Review the detailed migration log', '/upgrade-log')); + drupal_set_message(l('Review the detailed migration log', '/upgrade-log'), $status_type); } } }