Hi,
It seems like the plugin.manager.config_entity_migration service has been removed in the latest version of migrate_plus. Why was this done? Is there a replacement for this? I was using this to have a block of available migrations for a node so that a user could trigger the migrations from the UI when they wish. (see my screenshot).
I was using it like this:
$manager = \Drupal::service('plugin.manager.config_entity_migration');
$plugins = $manager->createInstances([]);
$active_migrations = array();
$flipped = array_flip($migrations);
foreach ($plugins as $id => $migration) {
if (in_array($id, $migrations)) {
$active_migrations[$id] = $flipped[$id];
}
}
The trick for me is finding the migrations associated with this node. (One node can have 0 to 5 migrations) and so I determine which are enabled and then loop through the migration entity configs to find matches. How can this be done now?
Thanks,
Donovan
Comments
Comment #2
tmountjr commentedFor me this error also appears after upgrading from beta2 to beta4, then going to
admin/structure/migrate/manage/default/migrations. The on-screen error is a white screen with "The website encountered an unexpected error. Please try again later."; the watchdog logs contain the actual PHP error:Comment #3
firfin commentedMight be related. I am getting this in watchdog when I try to 'List igrations' from /admin/structure/migrate :
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "plugin.manager.config_entity_migration". Did you mean this: "plugin.manager.commerce_entity_trait"? in Drupal\Component\DependencyInjection\Container->get() (line 157 of /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php).
Comment #4
ctrladelLooks like the issue in #2 and #3 is a regression from #2752335: Properly integrate configuration-entity-based migrations with the core plugin manager. As far as the original issue I think we can now create instances through the normal drupal service like this
Comment #5
grantkruger#4 worked for me, or at least something similar, essentially changing plugin.manager.config_entity_migration to plugin.manager.migration
Comment #6
mikeryanYes, when we implemented a deriver to pull in config-entity-based migration we no longer needed plugin.manager.config_entity_migration, so we deprecated it and later removed it.