diff --git a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php index 898a8a5568..ca5a51326f 100644 --- a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php +++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php @@ -160,6 +255,9 @@ public function submitForm(array &$form, FormStateInterface $form_state) { public function buildOverviewForm(array $form, FormStateInterface $form_state) { $form['#title'] = $this->t('Upgrade'); + // Add the no upgrade path array to the form state so it can be altered. + $form_state->set('no_upgrade_paths', $this->noUpgradePaths); + if ($date_performed = $this->state->get('migrate_drupal_ui.performed')) { // @todo Add back support for rollbacks and incremental migrations. // https://www.drupal.org/node/2687843 diff --git a/core/modules/migrate_drupal_ui/tests/modules/upgrade_form_alter_test/upgrade_form_alter_test.info.yml b/core/modules/migrate_drupal_ui/tests/modules/upgrade_form_alter_test/upgrade_form_alter_test.info.yml new file mode 100644 index 0000000000..c6b66cdb34 --- /dev/null +++ b/core/modules/migrate_drupal_ui/tests/modules/upgrade_form_alter_test/upgrade_form_alter_test.info.yml @@ -0,0 +1,6 @@ +name: 'Upgrade form alter test' +type: module +description: 'Tests that contrib modules can alter the upgrade form.' +package: Testing +version: VERSION +core: 8.x diff --git a/core/modules/migrate_drupal_ui/tests/modules/upgrade_form_alter_test/upgrade_form_alter_test.module b/core/modules/migrate_drupal_ui/tests/modules/upgrade_form_alter_test/upgrade_form_alter_test.module new file mode 100644 index 0000000000..8855721dc3 --- /dev/null +++ b/core/modules/migrate_drupal_ui/tests/modules/upgrade_form_alter_test/upgrade_form_alter_test.module @@ -0,0 +1,18 @@ +get('no_upgrade_paths'); + $no_upgrade_paths['6'][] = 'event'; + $no_upgrade_paths['7'][] = 'book'; + $form_state->set('no_upgrade_paths', $no_upgrade_paths); +} diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php index 1e93d8d840..4955acbd24 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php @@ -30,6 +30,7 @@ class MigrateUpgrade7Test extends MigrateUpgradeTestBase { 'forum', 'statistics', 'migration_provider_test', + 'upgrade_form_alter_test', ]; /** @@ -133,9 +132,25 @@ protected function getAvailablePaths() { 'system', 'taxonomy', 'text', - 'translation', 'user', - 'user_reference', + // Include modules that do not have an upgrade path and are enabled in the + // source database, defined in the $noUpgradePath property + // in MigrateUpgradeForm. + 'blog', + 'contextual', + 'date_api', + 'entity', + 'field_ui', + 'help', + 'php', + 'simpletest', + 'toolbar', + 'translation', + 'trigger', + // To test that contrib modules can alter this list, Book is added here + // by a hook_form_alter(). + // @see upgrade_form_alter_test_form_migrate_drupal_ui_form_alter(). + 'book', ]; } @@ -144,21 +159,15 @@ protected function getAvailablePaths() { */ protected function getMissingPaths() { return [ - 'blog', - 'book', + // To test that contrib modules can alter this list, Book is removed from + // here by a hook_form_alter(). + // @see upgrade_form_alter_test_form_migrate_drupal_ui_form_alter(). 'color', - 'contextual', - 'date_api', - 'entity', - 'field_ui', - 'help', - 'php', 'rdf', - 'simpletest', + // These modules are in the missing path list because they are installed + // on the source site but they are not installed on the destination site. 'syslog', - 'toolbar', 'tracker', - 'trigger', 'update', ]; }