- Merge request !13209[#3546325] fix: Recent changes to migrate_drupal can break migrations that rely on hook_migration_plugins_alter() β (Open) created by joegraduate
Recent changes made to Drupal\migrate_tools\MigrationPluginManager::processDefinition()
as part of
π
Move source_module and destination_module from Migrate to Migrate Drupal
Needs work
caused a regression for sites using migration plugins with source plugin definitions that are added via hook_migration_plugins_alter()
implementations, e.g. through shared configuration defined in a migrate_plus migration group.
The new code added to Drupal\migrate_tools\MigrationPluginManager::processDefinition()
assumes that source plugin IDs will already exist in migration plugin definitions (and does not sufficiently check that they do exist). This is not always the case because modules can alter migration plugin definitions via hook_migration_plugins_alter()
and Drupal\Core\Plugin\DefaultPluginManager:: findDefinitions()
doesn't apply alter hook implementations on plugin definitions until after processing each definition with ::processDefinition()
.
This change causes migration operations involving these migrations to fail with PHP warnings like these:
Warning: Undefined array key "plugin" in Drupal\migrate_drupal\MigrationPluginManager->processDefinition() (line 90 of core/modules/migrate_drupal/src/MigrationPluginManager.php).
Drupal\migrate_drupal\MigrationPluginManager->processDefinition() (Line: 257)
Drupal\migrate\Plugin\MigrationPluginManager->findDefinitions() (Line: 216)
Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 146)
Drupal\migrate\Plugin\MigrationPluginManager->expandPluginIds() (Line: 114)
Drupal\migrate\Plugin\MigrationPluginManager->createInstances() (Line: 93)
Drupal\migrate\Plugin\MigrationPluginManager->createInstance() (Line: 124)
Add some sanity checking code to the recent additions made to Drupal\migrate_tools\MigrationPluginManager::processDefinition() to make it less fragile.
Active
11.0 π₯
migration system
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.