| @@ 65-69 (lines=5) @@ | ||
| 62 | ||
| 63 | if ($rollback == TRUE) { |
|
| 64 | // Queue migrations to rollback in the opposite order provided. |
|
| 65 | foreach (array_reverse($migrations[$scenario]) as $machine_name) { |
|
| 66 | migrate_static_registration(array($machine_name)); |
|
| 67 | $migration = Migration::getInstance($machine_name); |
|
| 68 | $operations[] = array('migrate_ui_batch', array('rollback', $machine_name, array('unit' => 'items', 'value' => ''), FALSE)); |
|
| 69 | } |
|
| 70 | } |
|
| 71 | ||
| 72 | // Queue migrations to import in the provided order. |
|
| @@ 73-77 (lines=5) @@ | ||
| 70 | } |
|
| 71 | ||
| 72 | // Queue migrations to import in the provided order. |
|
| 73 | foreach ($migrations[$scenario] as $machine_name) { |
|
| 74 | migrate_static_registration(array($machine_name)); |
|
| 75 | $migration = Migration::getInstance($machine_name); |
|
| 76 | $operations[] = array('migrate_ui_batch', array('import', $machine_name, array('unit' => 'items', 'value' => ''), FALSE)); |
|
| 77 | } |
|
| 78 | ||
| 79 | // Confirm if there was an attempt to run scenario migrations. |
|
| 80 | $migrations_count = count($migrations[$scenario]); |
|
| @@ 46-49 (lines=4) @@ | ||
| 43 | $migrations = module_invoke_all('df_import'); |
|
| 44 | drupal_alter('df_import', $migrations); |
|
| 45 | $operations = array(); |
|
| 46 | foreach (array_reverse($migrations[$scenario]) as $machine_name) { |
|
| 47 | migrate_static_registration(array($machine_name)); |
|
| 48 | $operations[] = array('migrate_ui_batch', array('rollback', $machine_name, array('unit' => 'items', 'value' => ''), FALSE)); |
|
| 49 | } |
|
| 50 | $batch = array( |
|
| 51 | 'operations' => $operations, |
|
| 52 | 'title' => t('Sub-scenario base scenario rollback.'), |
|
| @@ 51-54 (lines=4) @@ | ||
| 48 | // Check for available migrations based on the scenario. |
|
| 49 | if (isset($migrations[$scenario]) && !empty($migrations[$scenario])) { |
|
| 50 | // Queue migrations to rollback in the opposite order provided. |
|
| 51 | foreach (array_reverse($migrations[$scenario]) as $machine_name) { |
|
| 52 | migrate_static_registration(array($machine_name)); |
|
| 53 | $operations[] = array('migrate_ui_batch', array('rollback', $machine_name, array('unit' => 'items', 'value' => ''), FALSE)); |
|
| 54 | } |
|
| 55 | } |
|
| 56 | ||
| 57 | // Uninstall features and the scenario. |
|