Commit 688e42fd authored by catch's avatar catch

Issue #2683421 by xjm, alexpott, hussainweb: Remove incremental and rollback...

Issue #2683421 by xjm, alexpott, hussainweb: Remove incremental and rollback options from the UI (and add them back when they are more stable)
parent 4da00503
......@@ -64,11 +64,14 @@ class MigrateUpgradeRunBatch {
* @param int[] $initial_ids
* The full set of migration IDs to import.
* @param string $operation
* The operation to perform, 'import' or 'rollback'.
* The operation to perform. Only 'import' is currently supported.
* @param array $config
* An array of additional configuration from the form.
* @param array $context
* The batch context.
*
* @todo Remove the $operation parameter and conditionals for it below, and
* refactor this method. https://www.drupal.org/node/2687851
*/
public static function run($initial_ids, $operation, $config, &$context) {
if (!static::$listenersAdded) {
......@@ -78,10 +81,6 @@ public static function run($initial_ids, $operation, $config, &$context) {
$event_dispatcher->addListener(MigrateEvents::MAP_SAVE, [static::class, 'onMapSave']);
$event_dispatcher->addListener(MigrateEvents::IDMAP_MESSAGE, [static::class, 'onIdMapMessage']);
}
else {
$event_dispatcher->addListener(MigrateEvents::POST_ROW_DELETE, [static::class, 'onPostRowDelete']);
$event_dispatcher->addListener(MigrateEvents::MAP_DELETE, [static::class, 'onMapDelete']);
}
static::$maxExecTime = ini_get('max_execution_time');
if (static::$maxExecTime <= 0) {
static::$maxExecTime = 60;
......@@ -131,9 +130,6 @@ public static function run($initial_ids, $operation, $config, &$context) {
if ($operation == 'import') {
$migration_status = $executable->import();
}
else {
$migration_status = $executable->rollback();
}
}
catch (\Exception $e) {
static::logger()->error($e->getMessage());
......@@ -149,11 +145,6 @@ public static function run($initial_ids, $operation, $config, &$context) {
$context['sandbox']['num_processed'], 'Upgraded @migration (processed 1 item total)', 'Upgraded @migration (processed @num_processed items total)',
['@migration' => $migration_name, '@num_processed' => $context['sandbox']['num_processed']]);
}
else {
$message = static::getTranslation()->formatPlural(
$context['sandbox']['num_processed'], 'Rolled back @migration (processed 1 item total)', 'Rolled back @migration (processed @num_processed items total)',
['@migration' => $migration_name, '@num_processed' => $context['sandbox']['num_processed']]);
}
$context['sandbox']['messages'][] = $message;
static::logger()->notice($message);
$context['sandbox']['num_processed'] = 0;
......@@ -222,13 +213,6 @@ public static function run($initial_ids, $operation, $config, &$context) {
'@max' => $context['sandbox']['max'],
]) . "<br />\n" . $context['message'];
}
else {
$context['message'] = t('Currently rolling back @migration (@current of @max total tasks)', [
'@migration' => $migration_name,
'@current' => $context['sandbox']['current'],
'@max' => $context['sandbox']['max'],
]) . "<br />\n" . $context['message'];
}
}
}
else {
......@@ -281,9 +265,6 @@ protected static function displayResults($results) {
if ($results['operation'] == 'import') {
drupal_set_message(static::getTranslation()->formatPlural($successes, 'Completed 1 upgrade task successfully', 'Completed @count upgrade tasks successfully'));
}
else {
drupal_set_message(static::getTranslation()->formatPlural($successes, 'Completed 1 rollback task successfully', 'Completed @count rollback tasks successfully'));
}
}
// If we had failures, log them and show the migration failed.
......@@ -292,10 +273,6 @@ protected static function displayResults($results) {
drupal_set_message(static::getTranslation()->formatPlural($failures, '1 upgrade failed', '@count upgrades failed'));
drupal_set_message(t('Upgrade process not completed'), 'error');
}
else {
drupal_set_message(static::getTranslation()->formatPlural($failures, '1 rollback failed', '@count rollbacks failed'));
drupal_set_message(t('Rollback process not completed'), 'error');
}
}
else {
if ($results['operation'] == 'import') {
......@@ -303,9 +280,6 @@ protected static function displayResults($results) {
// but we didn't have failures so this is fine.
drupal_set_message(t('Congratulations, you upgraded Drupal!'));
}
else {
drupal_set_message(t('Rollback of the upgrade is complete - you may now start the upgrade process from scratch.'));
}
}
if (\Drupal::moduleHandler()->moduleExists('dblog')) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment