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

CommentFileSizeAuthor
migrate_trigger.png71.46 KBdpalmer

Comments

dpalmer created an issue. See original summary.

tmountjr’s picture

For 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:

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "plugin.manager.config_entity_migration". in Drupal\Component\DependencyInjection\Container->get() (line 157 of /var/www/core/lib/Drupal/Component/DependencyInjection/Container.php).
firfin’s picture

Might 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).

ctrladel’s picture

Looks 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

  $pluginManager = \Drupal::service('plugin.manager.migration');
  $instance = $pluginManager->createInstance('some_migration');
grantkruger’s picture

#4 worked for me, or at least something similar, essentially changing plugin.manager.config_entity_migration to plugin.manager.migration

mikeryan’s picture

Category: Bug report » Support request
Status: Active » Fixed

Yes, 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.