reverted: --- b/core/modules/migrate/src/Plugin/migrate/source/EmptySource.php +++ a/core/modules/migrate/src/Plugin/migrate/source/EmptySource.php @@ -19,8 +19,7 @@ * elements, with values of 'user' and 'image', respectively. * * @MigrateSource( + * id = "empty" - * id = "empty", - * source_module = "migrate", * ) */ class EmptySource extends SourcePluginBase { reverted: --- b/core/modules/migrate/tests/modules/migrate_high_water_test/src/Plugin/migrate/source/HighWaterTest.php +++ a/core/modules/migrate/tests/modules/migrate_high_water_test/src/Plugin/migrate/source/HighWaterTest.php @@ -8,8 +8,7 @@ * Source plugin for migration high water tests. * * @MigrateSource( + * id = "high_water_test" - * id = "high_water_test", - * source_module = "migrate_high_water_test", * ) */ class HighWaterTest extends SqlBase { reverted: --- b/core/modules/migrate/tests/modules/migrate_query_batch_test/src/Plugin/migrate/source/QueryBatchTest.php +++ a/core/modules/migrate/tests/modules/migrate_query_batch_test/src/Plugin/migrate/source/QueryBatchTest.php @@ -8,8 +8,7 @@ * Source plugin for migration high water tests. * * @MigrateSource( + * id = "query_batch_test" - * id = "query_batch_test", - * source_module = "migrate_query_batch_test", * ) */ class QueryBatchTest extends SqlBase { diff -u b/core/modules/migrate_drupal/src/MigrationPluginManager.php b/core/modules/migrate_drupal/src/MigrationPluginManager.php --- b/core/modules/migrate_drupal/src/MigrationPluginManager.php +++ b/core/modules/migrate_drupal/src/MigrationPluginManager.php @@ -12,6 +12,16 @@ /** * Manages migration plugins. + * + * Analyzes migration definitions to ensure that the source plugin of any + * migration tagged with particular tags ('Drupal 6' or 'Drupal 7' by default) + * defines a source_module property in its plugin annotation. This is done in + * order to support the Migrate Drupal UI, which needs to known which modules + * "own" the data being migrated into Drupal 8, on both the source and + * destination sides. + * + * @todo Enforce the destination_module property too, in + * https://www.drupal.org/project/drupal/issues/2923810. */ class MigrationPluginManager extends BaseMigrationPluginManager { @@ -86,8 +96,8 @@ // enforcement. $applied_tags = array_intersect($this->getEnforcedSourceModuleTags(), $definition['migration_tags']); if ($applied_tags) { - // Throw a loud exception if the source plugin definition does not define - // a source_module. + // Throw an exception if the source plugin definition does not define a + // source_module. $source_id = $definition['source']['plugin']; $source_definition = $this->sourceManager->getDefinition($source_id); if (empty($source_definition['source_module'])) { diff -u b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeDeriverTest.php b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeDeriverTest.php --- b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeDeriverTest.php +++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeDeriverTest.php @@ -10,14 +10,29 @@ * @group migrate_drupal_6 */ class MigrateNodeDeriverTest extends MigrateDrupal6TestBase { + /** + * The migration plugin manager. + * + * @var \Drupal\migrate\Plugin\MigrationPluginManagerInterface + */ + protected $pluginManager; + + /** + * {@inheritdoc} + */ + public function setUp() { + parent::setUp(); + $this->pluginManager = $this->container->get('plugin.manager.migration'); + } /** * Test node translation migrations with translation disabled. */ public function testNoTranslations() { // Without content_translation, there should be no translation migrations. - $migrations = $this->container->get('plugin.manager.migration')->createInstances('d6_node_translation'); - $this->assertEmpty($migrations, "No node translation migrations without content_translation"); + $migrations = $this->pluginManager->createInstances('d6_node_translation'); + $this->assertSame([], $migrations, + "No node translation migrations without content_translation"); } /**