diff --git a/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php b/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php index 6b4ce17693..46fea2f830 100644 --- a/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php +++ b/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php @@ -383,10 +383,13 @@ protected function initUserSession() { */ protected function initKernel(Request $request) { $this->kernel = DrupalKernel::createFromRequest($request, $this->classLoader, 'prod', TRUE); - $this->kernel->prepareLegacyRequest($request); + // Force the container to be built from scratch instead of loaded from the // disk. This forces us to not accidentally load the parent site. - return $this->kernel->rebuildContainer(); + $this->kernel->invalidateContainer(); + + $this->kernel->prepareLegacyRequest($request); + return \Drupal::getContainer(); } /** @@ -420,8 +423,8 @@ protected function installModulesFromClassProperty(ContainerInterface $container // The exception message has all the details. $this->fail($e->getMessage()); } - - $this->rebuildContainer(); + // The container was already rebuilt by the ModuleInstaller. + $this->container = \Drupal::getContainer(); } } diff --git a/core/modules/action/action.migrate_drupal.yml b/core/modules/action/action.migrate_drupal.yml new file mode 100644 index 0000000000..7a656547ca --- /dev/null +++ b/core/modules/action/action.migrate_drupal.yml @@ -0,0 +1,7 @@ +finished: + 6: + system: action + action: action + 7: + system: action + action: action diff --git a/core/modules/aggregator/aggregator.migrate_drupal.yml b/core/modules/aggregator/aggregator.migrate_drupal.yml new file mode 100644 index 0000000000..fe63da70bf --- /dev/null +++ b/core/modules/aggregator/aggregator.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + aggregator: aggregator + 7: + aggregator: aggregator diff --git a/core/modules/ban/ban.migrate_drupal.yml b/core/modules/ban/ban.migrate_drupal.yml new file mode 100644 index 0000000000..34231fdd2d --- /dev/null +++ b/core/modules/ban/ban.migrate_drupal.yml @@ -0,0 +1,3 @@ +finished: + 7: + system: ban diff --git a/core/modules/block/block.migrate_drupal.yml b/core/modules/block/block.migrate_drupal.yml new file mode 100644 index 0000000000..74cdfc7191 --- /dev/null +++ b/core/modules/block/block.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + block: block + 7: + block: block diff --git a/core/modules/block_content/block_content.migrate_drupal.yml b/core/modules/block_content/block_content.migrate_drupal.yml new file mode 100644 index 0000000000..88391eed00 --- /dev/null +++ b/core/modules/block_content/block_content.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + block: block_content + 7: + block: block_content diff --git a/core/modules/book/book.migrate_drupal.yml b/core/modules/book/book.migrate_drupal.yml new file mode 100644 index 0000000000..c47d1e973f --- /dev/null +++ b/core/modules/book/book.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + book: book + 7: + book: book diff --git a/core/modules/color/color.migrate_drupal.yml b/core/modules/color/color.migrate_drupal.yml new file mode 100644 index 0000000000..60e95b99eb --- /dev/null +++ b/core/modules/color/color.migrate_drupal.yml @@ -0,0 +1,3 @@ +finished: + 7: + color: color diff --git a/core/modules/comment/comment.migrate_drupal.yml b/core/modules/comment/comment.migrate_drupal.yml new file mode 100644 index 0000000000..51dc1a0290 --- /dev/null +++ b/core/modules/comment/comment.migrate_drupal.yml @@ -0,0 +1,7 @@ +finished: + 6: + comment: comment + node: comment + 7: + comment: comment + node: comment diff --git a/core/modules/config_translation/config_translation.migrate_drupal.yml b/core/modules/config_translation/config_translation.migrate_drupal.yml new file mode 100644 index 0000000000..7b4518fed4 --- /dev/null +++ b/core/modules/config_translation/config_translation.migrate_drupal.yml @@ -0,0 +1,22 @@ +finished: + 6: + i18nprofile: config_translation + 7: + i18n_variable: config_translation +not_finished: + 6: + # language content comment settings. + locale: language + i18n: config_translation + # field labels and descriptions, synchronized fields. + i18ncck: config_translation + # + i18ntaxonomy: config_translation + 7: + # language content comment settings. + locale: language + i18n: config_translation + # field labels and descriptions, field options. + i18n_field: config_translation + # localized. vocabulary language settings, taxonomy term language. + i18n_taxonomy: config_translation diff --git a/core/modules/contact/contact.migrate_drupal.yml b/core/modules/contact/contact.migrate_drupal.yml new file mode 100644 index 0000000000..6b186b4299 --- /dev/null +++ b/core/modules/contact/contact.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + contact: contact + 7: + contact: contact diff --git a/core/modules/content_translation/content_translation.migrate_drupal.yml b/core/modules/content_translation/content_translation.migrate_drupal.yml new file mode 100644 index 0000000000..59d4f44172 --- /dev/null +++ b/core/modules/content_translation/content_translation.migrate_drupal.yml @@ -0,0 +1,23 @@ +finished: + 6: + i18nblocks: content_translation + i18nmenu: content_translation + menu: content_translation + statistics: statistics + taxonomy: content_translation + 7: + block: content_translation + entity_translation: content_translation + i18n_block: content_translation + menu: content_translation + statistics: statistics +not_finished: + # Also D6 an D7 node revision translations. + 6: + # Taxonomy term references. + i18ntaxonomy: content_translation + 7: + # menu links. + i18n_menu: content_translation + # localized. + i18n_taxonomy: content_translation diff --git a/core/modules/datetime/datetime.migrate_drupal.yml b/core/modules/datetime/datetime.migrate_drupal.yml new file mode 100644 index 0000000000..a4434b627e --- /dev/null +++ b/core/modules/datetime/datetime.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + date: datetime + 7: + date: datetime diff --git a/core/modules/dblog/dblog.migrate_drupal.yml b/core/modules/dblog/dblog.migrate_drupal.yml new file mode 100644 index 0000000000..b048ff1920 --- /dev/null +++ b/core/modules/dblog/dblog.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + dblog: dblog + 7: + dblog: dblog diff --git a/core/modules/field/field.migrate_drupal.yml b/core/modules/field/field.migrate_drupal.yml new file mode 100644 index 0000000000..1be6f48605 --- /dev/null +++ b/core/modules/field/field.migrate_drupal.yml @@ -0,0 +1,10 @@ +finished: + 6: + content: field + email: core + 7: + email: core + entityreference: core + field: field + field_sql_storage: field + number: core diff --git a/core/modules/file/file.migrate_drupal.yml b/core/modules/file/file.migrate_drupal.yml new file mode 100644 index 0000000000..cfee09a25c --- /dev/null +++ b/core/modules/file/file.migrate_drupal.yml @@ -0,0 +1,8 @@ +finished: + 6: + filefield: file + system: file + upload: file + 7: + file: file + system: file diff --git a/core/modules/filter/filter.migrate_drupal.yml b/core/modules/filter/filter.migrate_drupal.yml new file mode 100644 index 0000000000..fa671e830d --- /dev/null +++ b/core/modules/filter/filter.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + filter: filter + 7: + filter: filter diff --git a/core/modules/forum/forum.migrate_drupal.yml b/core/modules/forum/forum.migrate_drupal.yml new file mode 100644 index 0000000000..5b91754541 --- /dev/null +++ b/core/modules/forum/forum.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + forum: forum + 7: + forum: forum diff --git a/core/modules/image/image.migrate_drupal.yml b/core/modules/image/image.migrate_drupal.yml new file mode 100644 index 0000000000..b87b9c7b1a --- /dev/null +++ b/core/modules/image/image.migrate_drupal.yml @@ -0,0 +1,6 @@ +finished: + 6: + imagecache: image + imagefield: image + 7: + image: image diff --git a/core/modules/language/language.migrate_drupal.yml b/core/modules/language/language.migrate_drupal.yml new file mode 100644 index 0000000000..c36579cdc8 --- /dev/null +++ b/core/modules/language/language.migrate_drupal.yml @@ -0,0 +1,9 @@ +finished: + 6: + language: language + locale: language, system + system: language + taxonomy: language + 7: + language: language + locale: language, system diff --git a/core/modules/link/link.migrate_drupal.yml b/core/modules/link/link.migrate_drupal.yml new file mode 100644 index 0000000000..4352ab4c76 --- /dev/null +++ b/core/modules/link/link.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + link: link + 7: + link: link diff --git a/core/modules/locale/locale.migrate_drupal.yml b/core/modules/locale/locale.migrate_drupal.yml new file mode 100644 index 0000000000..5d4e806b80 --- /dev/null +++ b/core/modules/locale/locale.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + locale: locale + 7: + locale: locale diff --git a/core/modules/menu_link_content/menu_link_content.migrate_drupal.yml b/core/modules/menu_link_content/menu_link_content.migrate_drupal.yml new file mode 100644 index 0000000000..cb21ebe01b --- /dev/null +++ b/core/modules/menu_link_content/menu_link_content.migrate_drupal.yml @@ -0,0 +1,6 @@ +finished: + 6: + menu: menu_link_content + 7: + menu: menu_link_content + diff --git a/core/modules/menu_ui/menu_ui.migrate_drupal.yml b/core/modules/menu_ui/menu_ui.migrate_drupal.yml new file mode 100644 index 0000000000..55597fecfe --- /dev/null +++ b/core/modules/menu_ui/menu_ui.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + menu: menu_ui + 7: + menu: menu_ui diff --git a/core/modules/migrate/tests/src/Kernel/MigrateStatusTest.php b/core/modules/migrate/tests/src/Kernel/MigrateStatusTest.php index 7dc0b5b9b6..df9e770305 100644 --- a/core/modules/migrate/tests/src/Kernel/MigrateStatusTest.php +++ b/core/modules/migrate/tests/src/Kernel/MigrateStatusTest.php @@ -17,7 +17,7 @@ class MigrateStatusTest extends MigrateTestBase { public function testStatus() { // Create a minimally valid migration. $definition = [ - 'id' => 'migration_status_test', + 'id' => 'migrate_status_test', 'migration_tags' => ['Testing'], 'source' => ['plugin' => 'empty'], 'destination' => [ diff --git a/core/modules/migrate_drupal/migrate_drupal.migrate_drupal.yml b/core/modules/migrate_drupal/migrate_drupal.migrate_drupal.yml new file mode 100644 index 0000000000..db703dc95d --- /dev/null +++ b/core/modules/migrate_drupal/migrate_drupal.migrate_drupal.yml @@ -0,0 +1,4 @@ +finished: + 6: + nodereference: core + userreference: core diff --git a/core/modules/migrate_drupal/migrate_drupal.services.yml b/core/modules/migrate_drupal/migrate_drupal.services.yml index 7594b465fe..a413237900 100644 --- a/core/modules/migrate_drupal/migrate_drupal.services.yml +++ b/core/modules/migrate_drupal/migrate_drupal.services.yml @@ -25,3 +25,5 @@ services: - '@plugin.manager.migrate.field' - '@plugin.manager.migration' - '@logger.channel.migrate_drupal' + migrate_drupal.migration_state: + class: Drupal\migrate_drupal\MigrationState diff --git a/core/modules/migrate_drupal/src/MigrationConfigurationTrait.php b/core/modules/migrate_drupal/src/MigrationConfigurationTrait.php index f17768ef3b..ca778d8f9b 100644 --- a/core/modules/migrate_drupal/src/MigrationConfigurationTrait.php +++ b/core/modules/migrate_drupal/src/MigrationConfigurationTrait.php @@ -97,7 +97,7 @@ protected function createDatabaseStateSettings(array $database, $drupal_version) * @return \Drupal\migrate\Plugin\MigrationInterface[] * The migrations for import. */ - protected function getMigrations($database_state_key, $drupal_version) { + public function getMigrations($database_state_key, $drupal_version) { $version_tag = 'Drupal ' . $drupal_version; $plugin_manager = \Drupal::service('plugin.manager.migration'); /** @var \Drupal\migrate\Plugin\Migration[] $all_migrations */ @@ -210,4 +210,22 @@ protected function getLegacyDrupalVersion(Connection $connection) { return $version_string ? substr($version_string, 0, 1) : FALSE; } + /** + * {@inheritdoc} + */ + protected function getMigrationStates() { + /** @var \Drupal\migrate_drupal\MigrationState $migration_state */ + $migration_state = \Drupal::service('migrate_drupal.migration_state'); + return $migration_state->getMigrationStates(); + } + + /** + * {@inheritdoc} + */ + protected function getUpgradeStates($version, array $source_system_data, array $migrations) { + /** @var \Drupal\migrate_drupal\MigrationState $migration_state */ + $migration_state = \Drupal::service('migrate_drupal.migration_state'); + return $migration_state->getUpgradeStates($version, $source_system_data, $migrations); + } + } diff --git a/core/modules/migrate_drupal/src/MigrationState.php b/core/modules/migrate_drupal/src/MigrationState.php new file mode 100644 index 0000000000..31ba1bb82c --- /dev/null +++ b/core/modules/migrate_drupal/src/MigrationState.php @@ -0,0 +1,421 @@ +.migrate_drupal.yml file. + * + * The .migrate_drupal.yml file may use the following structure: + * - finished: (optional) List of the source_module/destination_module pairs + * for the migrations that this module provides and are complete. + * - version: A Drupal legacy version number. + * - source module: A list of destination modules. + * - not_finished: (optional) List of the source_module/destination_module pairs + * that this module provides, or will be providing, that are incomplete or do + * not yet exist. + * - version: A Drupal legacy version number. + * - source_module: A list of destination modules. + * + * Example: + * @code + * finished: + * 6: + * node: node + * 7: + * node: node + * entity_translation: node + * not_finished: + * 7: + * commerce_product: commerce_product + * @endcode + * + * In this example the module has completed the upgrade path for data from the + * Drupal 6 and Drupal 7 Node modules to the Drupal 8 Node module and for data + * from the Drupal 7 Entity Translation module to the Drupal 8 Node module. + * + * This module also plans on providing an upgrade path for data from the + * Drupal 7 Commerce Product module to the Drupal 8 Commerce Product module + * but either no migrations exist or some do and more migrations need to be + * created to finish the upgrade path. + */ +class MigrationState { + + /** + * Source module upgrade state when all its migrations are complete. + * + * @var string + */ + const FINISHED = 'finished'; + + /** + * Source module upgrade state when all its migrations are not complete. + * + * @var string + */ + const NOT_FINISHED = 'not_finished'; + + /** + * The field plugin manager service. + * + * @var \Drupal\migrate_drupal\Plugin\MigrateFieldPluginManagerInterface + */ + protected $fieldPluginManager; + + /** + * List of extensions that do not need an upgrade path. + * + * This property is an array where the keys are the major Drupal core version + * from which we are upgrading, and the values are arrays of extension names + * that do not need an upgrade path and are not names in the 'source_module' + * annotation for a migration. In other words, the functionality of these + * extensions has moved into core, or been dropped from core, and there isn't + * a Drupal 8 module of the same name. + * + * @var array[] + */ + protected $noUpgradePaths = [ + '6' => [ + 'blog', + 'blogapi', + 'calendarsignup', + 'color', + 'content_copy', + 'content_multigroup', + 'content_permissions', + 'date_api', + 'date_locale', + 'date_php4', + 'date_popup', + 'date_repeat', + 'date_timezone', + 'date_tools', + 'datepicker', + 'ddblock', + 'event', + 'fieldgroup', + 'filefield_meta', + 'help', + 'i18nstrings', + 'i18nsync', + 'imageapi', + 'imageapi_gd', + 'imageapi_imagemagick', + 'imagecache_ui', + 'jquery_ui', + 'nodeaccess', + 'number', + 'openid', + 'php', + 'ping', + 'poll', + 'throttle', + 'tracker', + 'translation', + 'trigger', + 'variable', + 'variable_admin', + 'views_export', + 'views_ui', + ], + '7' => [ + 'blog', + 'bulk_export', + 'contextual', + 'ctools', + 'ctools_access_ruleset', + 'ctools_ajax_sample', + 'ctools_custom_content', + 'dashboard', + 'date_all_day', + 'date_api', + 'date_context', + 'date_migrate', + 'date_popup', + 'date_repeat', + 'date_repeat_field', + 'date_tools', + 'date_views', + 'entity', + 'entity_feature', + 'entity_token', + 'entityreference', + 'field_ui', + 'help', + 'openid', + 'overlay', + 'page_manager', + 'php', + 'poll', + 'search_embedded_form', + 'search_extra_type', + 'search_node_tags', + 'simpletest', + 'stylizer', + 'term_depth', + 'title', + 'toolbar', + 'translation', + 'trigger', + 'views_content', + 'views_ui', + ], + ]; + + /** + * Construct a new MigrationState object. + */ + public function __construct() { + $this->fieldPluginManager = \Drupal::service('plugin.manager.migrate.field'); + } + + /** + * Gets the upgrade states for all enabled source modules. + * + * @param string $version + * The legacy drupal version. + * @param array $source_system_data + * The data from the source site system table. + * @param array $migrations + * An array of migrations. + * + * @return array + * An associative array of data with keys of state, source modules and a + * value which is a comma separated list of destination modules. + */ + public function getUpgradeStates($version, array $source_system_data, array $migrations) { + return $this->buildUpgradeState($version, $source_system_data, $migrations); + } + + /** + * Gets migration state information from *.migrate_drupal.yml. + * + * @return array + * An association array keyed by module of the finished and not_finished + * migrations for each module. + * */ + public function getMigrationStates() { + // Always instantiate a new YamlDiscovery object so that we always search on + // the up-to-date list of modules. + /** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */ + $module_handler = \Drupal::service('module_handler'); + $discovery = new YamlDiscovery('migrate_drupal', $module_handler->getModuleDirectories()); + return $discovery->findAll(); + } + + /** + * Determines migration state for each source module enabled on the source. + * + * If there are no migrations for a module and the module is listed in the + * NoUpgradePath list then the state is set to FINISHED. If it is not listed + * in NoUpgradePath list the state is to NOT_FINISHED. + * + * When there are migrations for a module the following happens. If the + * destination module is 'core' the state is set to FINISHED. If there are + * any occurrences of 'not_finished' in the *.migrate_drupal.yml information + * for this source module then the state is set to NOT_FINISHED otherwise the + * state is set to FINISHED. + * + * @param string $version + * The legacy drupal version. + * @param array $source_system_data + * The data from the source site system table. + * @param array $migrations + * An array of migrations. + * + * @return array + * An associative array of data with keys of state, source modules and a + * value which is a comma separated list of destination modules. + * Example. + * + * @code + * [ + * 'finished' => [ + * 'menu' => [ + * 'menu_link_content','menu_ui','system' + * ] + * ], + * ] + * @nedcode + */ + protected function buildUpgradeState($version, array $source_system_data, array $migrations) { + $source_destinations = $this->getSourceDestinations($version, $migrations); + $by_source = $this->getMigrationStatesBySource($version); + $upgrade_state = []; + // Loop through every source module that is enabled on the source site. + foreach ($source_system_data['module'] as $module) { + $source_module = $module['name']; + if ($module['status']) { + // Set the defaults to display. + $destination_modules = []; + $migration_state = static::NOT_FINISHED; + + // If there is a declared state for this source module, check the + // actual migrations to decide the final state. + if (isset($by_source[$source_module])) { + // Get the destination modules for this source module. + $destination_modules = isset($source_destinations[$source_module]) ? $source_destinations[$source_module] : []; + foreach ($by_source[$source_module] as $destination_module) { + // Some field plugins use a destination_module of 'core'. + if ($destination_module === 'core') { + $migration_state = static::FINISHED; + continue; + } + // Check the destination site system info for the state of the + // migrations for this source_module. + if (isset($by_source[$source_module])) { + // If migrations and no declaration then it is not finished. + if (empty($by_source[$source_module])) { + $migration_state = static::NOT_FINISHED; + continue; + } + // If 'not_finished' declared then it is not finished. + if (in_array('not_finished', $by_source[$source_module])) { + $migration_state = static::NOT_FINISHED; + continue; + } + // If 'finished' declared then it is finished. + if (in_array('finished', $by_source[$source_module])) { + $migration_state = static::FINISHED; + } + } + } + } + else { + // This may be a no upgrade path. + if (in_array($source_module, $this->noUpgradePaths[$version])) { + $migration_state = static::FINISHED; + $destination_modules = ['core']; + } + } + $destination_modules = array_unique($destination_modules); + sort($destination_modules); + $state = $migration_state; + $upgrade_state[$state][$source_module] = implode(', ', $destination_modules); + } + } + foreach ($upgrade_state as $key => $value) { + ksort($upgrade_state[$key]); + } + return $upgrade_state; + } + + /** + * Builds migration source and destination module information. + * + * @param string $version + * The legacy Drupal version. + * @param array $migrations + * The discovered migrations. + * + * @return array + * Array of migrations, keyed by source_module and destination_module. Only + * migrations that have both a source_module and a destination_module + * definition are added to the array. + */ + protected function getSourceDestinations($version, array $migrations) { + $source_destinations = []; + foreach ($migrations as $migration) { + $migration_id = $migration->getPluginId(); + $source_module = $migration->getSourcePlugin()->getSourceModule(); + if (!$source_module) { + $this->messenger() + ->addError($this->t('Source module not found for @migration_id.', ['@migration_id' => $migration_id])); + } + $destination_module = $migration->getDestinationPlugin() + ->getDestinationModule(); + if (!$destination_module) { + $this->messenger() + ->addError($this->t('Destination module not found for @migration_id.', ['@migration_id' => $migration_id])); + } + + if ($source_module && $destination_module) { + $source_destinations[$source_module][] = $destination_module; + } + } + + // Add entries for the field plugins to source_destinations. + $definitions = $this->fieldPluginManager->getDefinitions(); + foreach ($definitions as $definition) { + // This is not strict so that we find field plugins with an annotation + // where the Drupal core version is an integer and when it is a string. + if (in_array($version, $definition['core'])) { + $source_module = $definition['source_module']; + $destination_module = $definition['destination_module']; + $source_destinations[$source_module][] = $destination_module; + } + } + + // Remove duplicate destination_modules. + foreach ($source_destinations as $key => $destination_modules) { + $source_destinations[$key] = array_unique($destination_modules); + } + return $source_destinations; + } + + /** + * Gets migration data from *.migrate_drupal.yml sorted by source module. + * + * @param string $version + * The legacy Drupal version. + * + * @return array + * An array of migration states declared for each source migration. The key + * is the name of the source module and the value is an array of all the + * categories declared for this source module. + * Example + * + * @code + * 'some_source_module' => [ + * 'finished', + * 'finished', + * 'not_finished', + * ] + * @endcode + */ + protected function getMigrationStatesBySource($version) { + $migration_states = $this->getMigrationStates(); + + $by_source = []; + $states = ['finished', 'not_finished']; + foreach ($migration_states as $module => $info) { + foreach ($states as $state) { + if (isset($info[$state])) { + foreach ($info[$state] as $info_version => $migrate_info) { + if ($info_version == $version) { + foreach ($migrate_info as $source => $destination) { + $by_source[$source][] = $state; + } + } + } + } + } + } + return $by_source; + } + +} diff --git a/core/modules/migrate_drupal/tests/modules/migrate_state_finished_test/migrate_state_finished_test.info.yml b/core/modules/migrate_drupal/tests/modules/migrate_state_finished_test/migrate_state_finished_test.info.yml new file mode 100644 index 0000000000..a040bc537e --- /dev/null +++ b/core/modules/migrate_drupal/tests/modules/migrate_state_finished_test/migrate_state_finished_test.info.yml @@ -0,0 +1,6 @@ +name: Migrate state active test +type: module +description: Tests the 'active' migrate state +package: Testing +version: VERSION +core: 8.x diff --git a/core/modules/migrate_drupal/tests/modules/migrate_state_finished_test/migrate_state_finished_test.migrate_drupal.yml b/core/modules/migrate_drupal/tests/modules/migrate_state_finished_test/migrate_state_finished_test.migrate_drupal.yml new file mode 100644 index 0000000000..28fcac5a47 --- /dev/null +++ b/core/modules/migrate_drupal/tests/modules/migrate_state_finished_test/migrate_state_finished_test.migrate_drupal.yml @@ -0,0 +1,16 @@ +finished: + 6: + # A field migration + # migrate_state_finished_test: migrate_state_finished_test + aggregator: migrate_state_finished_test + action: migrate_state_finished_test, migrate_state_not_finished_test + 7: + # A field migration + # migrate_state_finished_test: migrate_state_finished_test + aggregator: migrate_state_finished_test + # Migrations + action: migrate_state_finished_test, migrate_state_not_finished_test +not_finished: + 7: + # Migrations + action: system diff --git a/core/modules/migrate_drupal/tests/modules/migrate_state_finished_test/migrations/migrate_state_finished_test.yml b/core/modules/migrate_drupal/tests/modules/migrate_state_finished_test/migrations/migrate_state_finished_test.yml new file mode 100644 index 0000000000..bffca64c6a --- /dev/null +++ b/core/modules/migrate_drupal/tests/modules/migrate_state_finished_test/migrations/migrate_state_finished_test.yml @@ -0,0 +1,20 @@ +id: migrate_state_finished_test +label: Block content body field configuration +migration_tags: + - Drupal 6 + - Drupal 7 + - Configuration +source: + plugin: embedded_data + data_rows: + - + id: 1 + ids: + id: + type: string + source_module: action +process: [] +destination: + plugin: entity:field_config + destination_module: migrate_state_finished_test + diff --git a/core/modules/migrate_drupal/tests/modules/migrate_state_finished_test/migrations/migrate_state_finished_test1.yml b/core/modules/migrate_drupal/tests/modules/migrate_state_finished_test/migrations/migrate_state_finished_test1.yml new file mode 100644 index 0000000000..e4c6df0d88 --- /dev/null +++ b/core/modules/migrate_drupal/tests/modules/migrate_state_finished_test/migrations/migrate_state_finished_test1.yml @@ -0,0 +1,20 @@ +id: migrate_state_finished_test1 +label: Block content body field configuration +migration_tags: + - Drupal 6 + - Drupal 7 + - Configuration +source: + plugin: embedded_data + data_rows: + - + id: 1 + ids: + id: + type: string + source_module: action +process: [] +destination: + plugin: entity:field_config + destination_module: migrate_state_not_finished_test + diff --git a/core/modules/migrate_drupal/tests/modules/migrate_state_finished_test/src/Plugin/migrate/field/FieldLeft.php b/core/modules/migrate_drupal/tests/modules/migrate_state_finished_test/src/Plugin/migrate/field/FieldLeft.php new file mode 100644 index 0000000000..1bbd444070 --- /dev/null +++ b/core/modules/migrate_drupal/tests/modules/migrate_state_finished_test/src/Plugin/migrate/field/FieldLeft.php @@ -0,0 +1,16 @@ +enableAllModules(); + + // Build an array for each migration keyed by provider. The value is a + // string consisting of the version number, the provider, the source_module + // and the destination module. + $discovered = []; + $versions = ['6', '7']; + /** @var \Drupal\migrate\Plugin\MigrationPluginManager $plugin_manager */ + $plugin_manager = $this->container->get('plugin.manager.migration'); + foreach ($versions as $version) { + $migrations = $plugin_manager->createInstancesByTag('Drupal ' . $version); + /** @var \Drupal\migrate\Plugin\Migration $migration */ + foreach ($migrations as $migration) { + $definition = $migration->getPluginDefinition(); + if (is_array($definition['provider'])) { + $provider = reset($definition['provider']); + } + else { + $provider = $definition['provider']; + } + + $source_module = $migration->getSourcePlugin()->getSourceModule(); + $destination_module = $migration->getDestinationPlugin() + ->getDestinationModule(); + + $discovered[] = implode(static::SEPARATOR, [ + $version, + $provider, + $source_module, + $destination_module, + ]); + } + } + + // Add the field migrations. + /** @var \Drupal\migrate\Plugin\MigrationPluginManager $plugin_manager */ + $definitions = $this->container->get('plugin.manager.migrate.field') + ->getDefinitions(); + foreach ($definitions as $key => $definition) { + foreach ($definition['core'] as $version) { + $discovered[] = implode(static::SEPARATOR, [ + $version, + $definition['provider'], + $definition['source_module'], + $definition['destination_module'], + ]); + } + } + + // Get the declared migration status information from .migrate_drupal.yml + // and build an array of source modules and there migration state. The + // destination is not used yet but can be later for validating the + // source/destination pairs with the actual source/destination pairs in the + // migrate plugins. + $system_info = $this->getMigrationStates(); + + $declared = []; + $states = ['finished', 'not_finished']; + foreach ($system_info as $module => $info) { + foreach ($states as $state) { + if (isset($info[$state])) { + foreach ($info[$state] as $info_version => $migrate_info) { + foreach ($migrate_info as $source => $destination) { + // Destination is a CSV. + $tmp = str_getcsv($destination); + foreach ($tmp as $dest) { + $key = [$info_version, $module, $source, trim($dest)]; + $declared[$state][] = implode(static::SEPARATOR, $key); + } + } + } + } + } + } + + // Sort and make the array values unique. + sort($declared['finished']); + sort($declared['not_finished']); + $declared_unique['finished'] = array_unique($declared['finished']); + $declared_unique['not_finished'] = array_unique($declared['not_finished']); + sort($discovered); + $discovered_unique = array_unique($discovered); + + // Assert that each migration state declared finished in .migrate.drupal.yml + // is in the list of discovered migrations. The migrations not finished are + // not asserted because a migration may or may not exist. + foreach ($declared_unique['finished'] as $datum) { + $data = str_getcsv($datum); + $this->assertContains($datum, $discovered_unique, sprintf("No migration found for version '%s' with source_module '%s' and destination_module '%s' declared in module '%s'", $data[0], $data[2], $data[3], $data[1])); + } + + // Assert that each migration has a corresponding declaration in the system + // .migrate_drupal.yml files. + foreach ($discovered_unique as $datum) { + $data = str_getcsv($datum); + $in_finished = in_array($datum, $declared_unique['finished']); + $in_not_finished = in_array($datum, $declared_unique['not_finished']); + $found = $in_finished || $in_not_finished; + $this->assertTrue($found, sprintf("No migration state found for version '%s' with source_module '%s' and destination_module '%s' declared in module '%s'", $data[0], $data[2], $data[3], $data[1])); + } + } + + /** + * Enable all available modules. + */ + protected function enableAllModules() { + // Install all available modules. + $module_handler = $this->container->get('module_handler'); + $modules = $this->coreModuleListDataProvider(); + $modules_enabled = $module_handler->getModuleList(); + $modules_to_enable = array_keys(array_diff_key($modules, $modules_enabled)); + $this->enableModules($modules_to_enable); + } + +} diff --git a/core/modules/migrate_drupal_multilingual/migrate_drupal_multilingual.migrate_drupal.yml b/core/modules/migrate_drupal_multilingual/migrate_drupal_multilingual.migrate_drupal.yml new file mode 100644 index 0000000000..d733618809 --- /dev/null +++ b/core/modules/migrate_drupal_multilingual/migrate_drupal_multilingual.migrate_drupal.yml @@ -0,0 +1,6 @@ +# Multilingual is not finished until this module is removed. +not_finished: + 6: + i18n: i18n + 7: + i18n: i18n diff --git a/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php index 6ef9dd564c..8ffe1305c5 100644 --- a/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php +++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php @@ -5,23 +5,45 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\State\StateInterface; use Drupal\Core\TempStore\PrivateTempStoreFactory; -use Drupal\migrate_drupal\Plugin\MigrateFieldPluginManagerInterface; use Drupal\migrate\Plugin\MigrationPluginManagerInterface; +use Drupal\migrate_drupal\Plugin\MigrateFieldPluginManagerInterface; use Drupal\migrate_drupal_ui\Batch\MigrateUpgradeImportBatch; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Migrate Upgrade review form. * - * This confirmation form uses the source_module and destination_module - * properties on the source, destination and field plugins as well as the - * system data from the source to determine if there is a migration path for - * each module in the source. + * This confirmation form provides the user with a summary of all the modules + * enabled on the source site and whether they will be upgraded or not. Data + * from a module's .migrate.yml file and all the migration plugins + * (source, destination and field) for each enabled Drupal 8 module are used to + * decide the migration status for each enabled module on the source site. + * + * The migration status displayed on the Review page is a list of all the + * enabled modules on the source site divided into two categories, those that + * will not be upgraded and those that will be upgraded. The intention is to + * provide the admin with enough information to decide if it is OK to proceed + * with the upgrade. * * @internal */ class ReviewForm extends MigrateUpgradeFormBase { + /** + * Source modules status for will be upgraded. + * + * @var string + */ + const FINISHED = 'finished'; + + /** + * Source modules status for will not be upgraded. + * + * @var string + */ + const NOT_FINISHED = 'not_finished'; + + /** * The state service. * @@ -51,101 +73,11 @@ class ReviewForm extends MigrateUpgradeFormBase { protected $migrations; /** - * List of extensions that do not need an upgrade path. - * - * This property is an array where the keys are the major Drupal core version - * from which we are upgrading, and the values are arrays of extension names - * that do not need an upgrade path. + * Display data. * - * @var array[] + * @var array */ - protected $noUpgradePaths = [ - '6' => [ - 'blog', - 'blogapi', - 'calendarsignup', - 'color', - 'content_copy', - 'content_multigroup', - 'content_permissions', - 'date_api', - 'date_locale', - 'date_php4', - 'date_popup', - 'date_repeat', - 'date_timezone', - 'date_tools', - 'datepicker', - 'ddblock', - 'event', - 'fieldgroup', - 'filefield_meta', - 'help', - 'i18nstrings', - 'i18nsync', - 'imageapi', - 'imageapi_gd', - 'imageapi_imagemagick', - 'imagecache_ui', - 'jquery_ui', - 'nodeaccess', - 'number', - 'openid', - 'php', - 'ping', - 'poll', - 'throttle', - 'tracker', - 'translation', - 'trigger', - 'variable', - 'variable_admin', - 'views_export', - 'views_ui', - ], - '7' => [ - 'blog', - 'bulk_export', - 'contextual', - 'ctools', - 'ctools_access_ruleset', - 'ctools_ajax_sample', - 'ctools_custom_content', - 'dashboard', - 'date_all_day', - 'date_api', - 'date_context', - 'date_migrate', - 'date_popup', - 'date_repeat', - 'date_repeat_field', - 'date_tools', - 'date_views', - 'entity', - 'entity_feature', - 'entity_token', - 'entityreference', - 'field_ui', - 'help', - 'openid', - 'overlay', - 'page_manager', - 'php', - 'poll', - 'search_embedded_form', - 'search_extra_type', - 'search_node_tags', - 'simpletest', - 'stylizer', - 'term_depth', - 'title', - 'toolbar', - 'translation', - 'trigger', - 'views_content', - 'views_ui', - ], - ]; + protected $display; /** * ReviewForm constructor. @@ -192,9 +124,14 @@ public function buildForm(array $form, FormStateInterface $form_state) { // Get all the data needed for this form. $version = $this->store->get('version'); $this->migrations = $this->store->get('migrations'); - // Fetch the system data at the first opportunity. + // Fetch the source system data at the first opportunity. $system_data = $this->store->get('system_data'); + // Remove core profiles from the system data. + foreach (['standard', 'minimal'] as $profile) { + unset($system_data['module'][$profile]); + } + // If data is missing or this is the wrong step, start over. if (!$version || !$this->migrations || !$system_data || ($this->store->get('step') != 'review')) { @@ -204,58 +141,10 @@ public function buildForm(array $form, FormStateInterface $form_state) { $form = parent::buildForm($form, $form_state); $form['#title'] = $this->t('What will be upgraded?'); - // Get the source_module and destination_module for each migration. $migrations = $this->pluginManager->createInstances(array_keys($this->store->get('migrations'))); - $table_data = []; - foreach ($migrations as $migration) { - $migration_id = $migration->getPluginId(); - $source_module = $migration->getSourcePlugin()->getSourceModule(); - if (!$source_module) { - $this->messenger()->addError($this->t('Source module not found for @migration_id.', ['@migration_id' => $migration_id])); - } - $destination_module = $migration->getDestinationPlugin()->getDestinationModule(); - if (!$destination_module) { - $this->messenger()->addError($this->t('Destination module not found for @migration_id.', ['@migration_id' => $migration_id])); - } - if ($source_module && $destination_module) { - $table_data[$source_module][$destination_module][$migration_id] = $migration->label(); - } - } - - // Get the source_module and destination_module from the field plugins. - $definitions = $this->fieldPluginManager->getDefinitions(); - foreach ($definitions as $definition) { - // This is not strict so that we find field plugins with an annotation - // where the Drupal core version is an integer and when it is a string. - if (in_array($version, $definition['core'])) { - $source_module = $definition['source_module']; - $destination_module = $definition['destination_module']; - $table_data[$source_module][$destination_module][$definition['id']] = $definition['id']; - } - } - - // Add source_module and destination_module for modules that do not need an - // upgrade path and are enabled on the source site. - foreach ($this->noUpgradePaths[$version] as $extension) { - if (isset($system_data['module'][$extension]) && $system_data['module'][$extension]['status']) { - $table_data[$extension]['core'][$extension] = $extension; - } - } - - // Sort the table by source module names and within that destination - // module names. - ksort($table_data); - foreach ($table_data as $source_module => $destination_module_info) { - ksort($table_data[$source_module]); - } - - // Remove core profiles from the system data. - foreach (['standard', 'minimal'] as $profile) { - unset($system_data['module'][$profile]); - } - - $unmigrated_source_modules = array_diff_key($system_data['module'], $table_data); + // Get the upgrade states for the source modules. + $display = $this->getUpgradeStates($version, $system_data, $migrations); // Missing migrations. $missing_module_list = [ @@ -263,7 +152,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#open' => TRUE, '#title' => $this->t('Modules that will not be upgraded'), '#summary_attributes' => ['id' => ['error']], - '#description' => $this->t('There are no modules installed on your new site to replace these modules. If you proceed with the upgrade now, configuration and/or content needed by these modules will not be available on your new site. For more information, see Review the pre-upgrade analysis in the Upgrading to Drupal 8 handbook.', [':review' => 'https://www.drupal.org/docs/8/upgrade/upgrade-using-web-browser#pre-upgrade-analysis', ':migrate' => 'https://www.drupal.org/docs/8/upgrade']), + '#description' => $this->t("The new site is missing modules corresponding to the old site's modules. Unless they are installed prior to the upgrade, configuration and/or content needed by them will not be available on your new site. Read the checklist to help decide what to do.", [':review' => 'https://www.drupal.org/docs/8/upgrade/upgrade-using-web-browser#pre-upgrade-analysis']), '#weight' => 2, ]; $missing_module_list['module_list'] = [ @@ -273,12 +162,14 @@ public function buildForm(array $form, FormStateInterface $form_state) { $this->t('Drupal 8'), ], ]; + $missing_count = 0; - ksort($unmigrated_source_modules); - foreach ($unmigrated_source_modules as $source_module => $module_data) { - if ($module_data['status']) { + if (isset($display[static::NOT_FINISHED])) { + foreach ($display[static::NOT_FINISHED] as $source_module => $destination_modules) { $missing_count++; - $missing_module_list['module_list'][$source_module] = [ + // Get the migration status for this $source_module, if a module of the + // same name exists on the destination site. + $missing_module_list['module_list'][] = [ 'source_module' => [ '#type' => 'html_tag', '#tag' => 'span', @@ -290,7 +181,9 @@ public function buildForm(array $form, FormStateInterface $form_state) { ], ], ], - 'destination_module' => ['#plain_text' => 'Not upgraded'], + 'destination_module' => [ + '#plain_text' => $destination_modules, + ], ]; } } @@ -300,7 +193,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#type' => 'details', '#title' => $this->t('Modules that will be upgraded'), '#summary_attributes' => ['id' => ['checked']], - '#weight' => 3, + '#weight' => 4, ]; $available_module_list['module_list'] = [ @@ -312,29 +205,26 @@ public function buildForm(array $form, FormStateInterface $form_state) { ]; $available_count = 0; - foreach ($table_data as $source_module => $destination_module_info) { - $available_count++; - $destination_details = []; - foreach ($destination_module_info as $destination_module => $migration_ids) { - $destination_details[$destination_module] = [ - '#type' => 'item', - '#plain_text' => $destination_module, - ]; - } - $available_module_list['module_list'][$source_module] = [ - 'source_module' => [ - '#type' => 'html_tag', - '#tag' => 'span', - '#value' => $source_module, - '#attributes' => [ - 'class' => [ - 'upgrade-analysis-report__status-icon', - 'upgrade-analysis-report__status-icon--checked', + if (isset($display[static::FINISHED])) { + foreach ($display[static::FINISHED] as $source_module => $destination_modules) { + $available_count++; + $available_module_list['module_list'][] = [ + 'source_module' => [ + '#type' => 'html_tag', + '#tag' => 'span', + '#value' => $source_module, + '#attributes' => [ + 'class' => [ + 'upgrade-analysis-report__status-icon', + 'upgrade-analysis-report__status-icon--checked', + ], ], ], - ], - 'destination_module' => $destination_details, - ]; + 'destination_module' => [ + '#plain_text' => $destination_modules, + ], + ]; + } } $counters = []; @@ -354,9 +244,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { $counters[] = [ '#theme' => 'status_report_counter', '#amount' => $available_count, - '#text' => $this->formatPlural($available_count, 'Module will be upgraded', 'Modules will be upgraded'), - '#severity' => 'checked', - '#weight' => 1, + '#text' => $this->formatPlural($missing_count, 'Module will be upgraded', 'Modules will be upgraded'), + '#weight' => 2, ]; $general_info[] = $available_module_list; } diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php index f165bb7c8e..ed901febec 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php @@ -117,7 +117,7 @@ public function testMigrateUpgradeExecute() { // Ensure there are no errors about any other missing migration providers. $session->pageTextNotContains(t('module not found')); - // Test the upgrade paths. + // Test the review page. $available_paths = $this->getAvailablePaths(); $missing_paths = $this->getMissingPaths(); $this->assertReviewPage($session, $available_paths, $missing_paths); @@ -146,12 +146,7 @@ public function testMigrateUpgradeExecute() { $this->drupalPostForm(NULL, [], t('I acknowledge I may lose data. Continue anyway.')); $session->statusCodeEquals(200); - // Need to update available and missing path lists. - $all_available = $this->getAvailablePaths(); - $all_available[] = 'aggregator'; - $all_missing = $this->getMissingPaths(); - $all_missing = array_diff($all_missing, ['aggregator']); - $this->assertReviewPage($session, $all_available, $all_missing); + // Run the incremental migration and check the results. $this->drupalPostForm(NULL, [], t('Perform upgrade')); $session->pageTextContains(t('Congratulations, you upgraded Drupal!')); $this->assertMigrationResults($this->getEntityCountsIncremental(), $version); diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php index bc73aba4c4..14274bc572 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php @@ -169,13 +169,13 @@ protected function assertUpgradePaths(WebAssert $session, array $available_paths * Helper method to assert the text on the 'Upgrade analysis report' page. * * @param \Drupal\Tests\WebAssert $session - * The current session. - * @param array $all_available - * Array of modules that will be upgraded. - * @param array $all_missing - * Array of modules that will not be upgraded. + * The web-assert session. + * @param array $available_paths + * An array of modules that will be upgraded. + * @param array $missing_paths + * An array of modules that will not be upgraded. */ - protected function assertReviewPage(WebAssert $session, array $all_available, array $all_missing) { + protected function assertReviewPage(WebAssert $session, array $available_paths, array $missing_paths) { $this->assertText('What will be upgraded?'); // Ensure there are no errors about the missing modules from the test module. @@ -185,17 +185,7 @@ protected function assertReviewPage(WebAssert $session, array $all_available, ar // Ensure there are no errors about any other missing migration providers. $session->pageTextNotContains(t('module not found')); - // Test the available migration paths. - foreach ($all_available as $available) { - $session->elementExists('xpath', "//span[contains(@class, 'checked') and text() = '$available']"); - $session->elementNotExists('xpath', "//span[contains(@class, 'error') and text() = '$available']"); - } - - // Test the missing migration paths. - foreach ($all_missing as $missing) { - $session->elementExists('xpath', "//span[contains(@class, 'error') and text() = '$missing']"); - $session->elementNotExists('xpath', "//span[contains(@class, 'checked') and text() = '$missing']"); - } + $this->assertUpgradePaths($session, $available_paths, $missing_paths); } /** diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php index a200de6b84..16a7797c57 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php @@ -84,7 +84,8 @@ public function testMigrateUpgradeReviewPage() { $this->drupalPostForm(NULL, $this->edits, t('Review upgrade')); $this->drupalPostForm(NULL, [], t('I acknowledge I may lose data. Continue anyway.')); - // Test the upgrade paths. + // Test the upgrade paths. First remove the module from the available paths + // list. $available_paths = $this->getAvailablePaths(); $available_paths = array_diff($available_paths, [$module]); $missing_paths = $this->getMissingPaths(); @@ -138,6 +139,16 @@ public function prepare() { $conditions->condition('name', 'simpletest'); $update->condition($conditions); $update->execute(); + + // Create entries for D8 test modules. + $insert = $this->sourceDatabase->insert('system') + ->fields([ + 'filename' => 'migrate_status_active_test', + 'name' => 'migrate_status_active_test', + 'type' => 'module', + 'status' => 1, + ]); + $insert->execute(); } /** diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MultilingualReviewPageTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MultilingualReviewPageTest.php index 32ca9a150d..922a67485c 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MultilingualReviewPageTest.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MultilingualReviewPageTest.php @@ -31,6 +31,9 @@ class MultilingualReviewPageTest extends MultilingualReviewPageTestBase { 'update', // Required for translation migrations. 'migrate_drupal_multilingual', + // Test migrations statuses. + 'migrate_state_finished_test', + 'migrate_state_not_finished_test', ]; /** @@ -54,7 +57,6 @@ protected function getSourceBasePath() { protected function getAvailablePaths() { return [ 'aggregator', - 'block', 'book', 'comment', 'contact', @@ -65,18 +67,13 @@ protected function getAvailablePaths() { 'filefield', 'filter', 'forum', - 'i18n', 'i18nblocks', - 'i18ncck', 'i18nmenu', 'i18nprofile', 'i18nstrings', - 'i18ntaxonomy', 'imagecache', 'imagefield', - 'language', 'link', - 'locale', 'menu', 'node', 'nodereference', @@ -146,9 +143,15 @@ protected function getMissingPaths() { 'devel', 'devel_generate', 'devel_node_access', + 'block', + 'i18n', + 'i18ncck', 'i18ncontent', 'i18npoll', + 'i18ntaxonomy', 'i18nviews', + 'locale', + 'migrate_status_active_test', 'phone', 'views', ]; diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NoMultilingualReviewPageTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NoMultilingualReviewPageTest.php index cab85e79af..fdddedf121 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NoMultilingualReviewPageTest.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NoMultilingualReviewPageTest.php @@ -64,7 +64,6 @@ protected function getAvailablePaths() { 'forum', 'imagecache', 'imagefield', - 'language', 'link', 'locale', 'menu', @@ -129,6 +128,13 @@ protected function getAvailablePaths() { ]; } + /** + * {@inheritdoc} + */ + protected function getIncompletePaths() { + return []; + } + /** * {@inheritdoc} */ @@ -146,6 +152,7 @@ protected function getMissingPaths() { 'i18nprofile', 'i18ntaxonomy', 'i18nviews', + 'migrate_status_active_test', 'phone', 'views', ]; diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NoMultilingualTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NoMultilingualTest.php index a3f4f10dc8..2508c5b807 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NoMultilingualTest.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NoMultilingualTest.php @@ -128,7 +128,6 @@ protected function getAvailablePaths() { 'forum', 'imagecache', 'imagefield', - 'language', 'link', 'locale', 'menu', diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php index 37de86efcd..c2cb25d0cc 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php @@ -130,39 +130,33 @@ protected function getAvailablePaths() { 'contact', 'content', 'date', - 'dblog', 'email', 'filefield', 'filter', 'forum', - 'i18n', 'i18nblocks', - 'i18ncck', 'i18nmenu', 'i18nprofile', 'i18nstrings', - 'i18ntaxonomy', + 'i18nsync', 'imagecache', 'imagefield', - 'language', - 'link', - 'locale', 'menu', 'node', 'nodereference', 'optionwidgets', 'path', - 'profile', 'search', 'statistics', 'system', 'taxonomy', 'text', + 'translation', 'upload', 'user', 'userreference', // Include modules that do not have an upgrade path and are enabled in the - // source database, defined in the $noUpgradePath property + // source database', defined in the $noUpgradePath property // in MigrateUpgradeForm. 'date_api', 'date_timezone', @@ -180,7 +174,11 @@ protected function getAvailablePaths() { */ protected function getMissingPaths() { return [ + 'i18n', + 'i18ncck', 'i18ncontent', + 'i18ntaxonomy', + 'locale', ]; } diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MultilingualReviewPageTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MultilingualReviewPageTest.php index 5bde4b88ae..4e7b314a2b 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MultilingualReviewPageTest.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MultilingualReviewPageTest.php @@ -61,14 +61,13 @@ protected function getAvailablePaths() { 'date', 'dblog', 'email', - 'field', + 'entity_translation', 'field_sql_storage', 'file', 'filter', 'forum', 'image', 'i18n_block', - 'language', 'link', 'list', 'locale', @@ -112,7 +111,7 @@ protected function getAvailablePaths() { 'entity_feature', 'entity_token', 'entityreference', - 'entity_translation', + 'field', 'field_ui', 'help', 'openid', @@ -163,6 +162,7 @@ protected function getMissingPaths() { 'variable_realm', 'variable_store', 'variable_views', + 'migrate_status_active_test', 'views', ]; } diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/NoMultilingualTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/NoMultilingualTest.php index a3958a7bf8..176827223c 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/NoMultilingualTest.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/NoMultilingualTest.php @@ -164,6 +164,13 @@ protected function getAvailablePaths() { ]; } + /** + * {@inheritdoc} + */ + protected function getIncompletePaths() { + return []; + } + /** * {@inheritdoc} */ diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php index 9f6178e665..7c465d5e32 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php @@ -128,21 +128,22 @@ protected function getAvailablePaths() { 'color', 'comment', 'contact', + 'ctools', 'date', 'dblog', 'email', + 'entity_translation', 'entityreference', 'field', 'field_sql_storage', 'file', 'filter', 'forum', + 'i18n_block', 'i18n_variable', 'image', - 'language', 'link', 'list', - 'locale', 'menu', 'node', 'number', @@ -156,6 +157,7 @@ protected function getAvailablePaths() { 'system', 'taxonomy', 'text', + 'title', 'user', // Include modules that do not have an upgrade path and are enabled in the // source database, defined in the $noUpgradePath property @@ -180,6 +182,9 @@ protected function getAvailablePaths() { protected function getMissingPaths() { return [ 'i18n', + 'i18n_field', + 'i18n_string', + 'locale', 'variable', 'variable_realm', 'variable_store', diff --git a/core/modules/node/node.migrate_drupal.yml b/core/modules/node/node.migrate_drupal.yml new file mode 100644 index 0000000000..4b7099e9e7 --- /dev/null +++ b/core/modules/node/node.migrate_drupal.yml @@ -0,0 +1,6 @@ +finished: + 6: + content: node + node: node + 7: + node: node diff --git a/core/modules/options/options.migrate_drupal.yml b/core/modules/options/options.migrate_drupal.yml new file mode 100644 index 0000000000..a523c6432a --- /dev/null +++ b/core/modules/options/options.migrate_drupal.yml @@ -0,0 +1,6 @@ +finished: + 6: + optionwidgets: options + 7: + options: options + list: options diff --git a/core/modules/path/path.migrate_drupal.yml b/core/modules/path/path.migrate_drupal.yml new file mode 100644 index 0000000000..d8066b950d --- /dev/null +++ b/core/modules/path/path.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + path: path + 7: + path: path diff --git a/core/modules/rdf/rdf.migrate_drupal.yml b/core/modules/rdf/rdf.migrate_drupal.yml new file mode 100644 index 0000000000..8e9205d12c --- /dev/null +++ b/core/modules/rdf/rdf.migrate_drupal.yml @@ -0,0 +1,3 @@ +finished: + 7: + rdf: rdf diff --git a/core/modules/search/search.migrate_drupal.yml b/core/modules/search/search.migrate_drupal.yml new file mode 100644 index 0000000000..6011126e13 --- /dev/null +++ b/core/modules/search/search.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + search: search + 7: + search: search diff --git a/core/modules/shortcut/shortcut.migrate_drupal.yml b/core/modules/shortcut/shortcut.migrate_drupal.yml new file mode 100644 index 0000000000..f7901621ad --- /dev/null +++ b/core/modules/shortcut/shortcut.migrate_drupal.yml @@ -0,0 +1,3 @@ +finished: + 7: + shortcut: shortcut diff --git a/core/modules/simpletest/simpletest.migrate_drupal.yml b/core/modules/simpletest/simpletest.migrate_drupal.yml new file mode 100644 index 0000000000..f195ad82f3 --- /dev/null +++ b/core/modules/simpletest/simpletest.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + simpletest: simpletest + 7: + simpletest: simpletest diff --git a/core/modules/statistics/statistics.migrate_drupal.yml b/core/modules/statistics/statistics.migrate_drupal.yml new file mode 100644 index 0000000000..6d8189f7a8 --- /dev/null +++ b/core/modules/statistics/statistics.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + statistics: statistics + 7: + statistics: statistics diff --git a/core/modules/syslog/syslog.migrate_drupal.yml b/core/modules/syslog/syslog.migrate_drupal.yml new file mode 100644 index 0000000000..7573f7bd4a --- /dev/null +++ b/core/modules/syslog/syslog.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + syslog: syslog + 7: + syslog: syslog diff --git a/core/modules/system/system.migrate_drupal.yml b/core/modules/system/system.migrate_drupal.yml new file mode 100644 index 0000000000..0175174a28 --- /dev/null +++ b/core/modules/system/system.migrate_drupal.yml @@ -0,0 +1,7 @@ +finished: + 6: + menu: system + system: system + 7: + menu: system + system: system diff --git a/core/modules/taxonomy/taxonomy.migrate_drupal.yml b/core/modules/taxonomy/taxonomy.migrate_drupal.yml new file mode 100644 index 0000000000..cc2bb13e8f --- /dev/null +++ b/core/modules/taxonomy/taxonomy.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + taxonomy: core, taxonomy + 7: + taxonomy: core, taxonomy diff --git a/core/modules/telephone/telephone.migrate_drupal.yml b/core/modules/telephone/telephone.migrate_drupal.yml new file mode 100644 index 0000000000..0a39c8184a --- /dev/null +++ b/core/modules/telephone/telephone.migrate_drupal.yml @@ -0,0 +1,3 @@ +finished: + 7: + phone: telephone diff --git a/core/modules/text/text.migrate_drupal.yml b/core/modules/text/text.migrate_drupal.yml new file mode 100644 index 0000000000..013d02356a --- /dev/null +++ b/core/modules/text/text.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + text: text + 7: + text: text diff --git a/core/modules/tracker/tracker.migrate_drupal.yml b/core/modules/tracker/tracker.migrate_drupal.yml new file mode 100644 index 0000000000..eb162ad896 --- /dev/null +++ b/core/modules/tracker/tracker.migrate_drupal.yml @@ -0,0 +1,3 @@ +finished: + 7: + tracker: tracker diff --git a/core/modules/update/update.migrate_drupal.yml b/core/modules/update/update.migrate_drupal.yml new file mode 100644 index 0000000000..b411c89220 --- /dev/null +++ b/core/modules/update/update.migrate_drupal.yml @@ -0,0 +1,5 @@ +finished: + 6: + update: update + 7: + update: update diff --git a/core/modules/user/user.migrate_drupal.yml b/core/modules/user/user.migrate_drupal.yml new file mode 100644 index 0000000000..21f61a148b --- /dev/null +++ b/core/modules/user/user.migrate_drupal.yml @@ -0,0 +1,10 @@ +finished: + 6: + profile: user + user: user + 7: + profile: user + user: user +not_finished: + 7: + profile: user