diff -u b/core/modules/migrate/src/Plugin/Discovery/MigrateContainerDerivativeDiscoveryDecorator.php b/core/modules/migrate/src/Plugin/Discovery/MigrateContainerDerivativeDiscoveryDecorator.php --- b/core/modules/migrate/src/Plugin/Discovery/MigrateContainerDerivativeDiscoveryDecorator.php +++ b/core/modules/migrate/src/Plugin/Discovery/MigrateContainerDerivativeDiscoveryDecorator.php @@ -6,6 +6,11 @@ use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator; +/** + * Overrides ContainerDerivativeDiscoveryDecorator to pre-check providers. + * + * @ingroup migration + */ class MigrateContainerDerivativeDiscoveryDecorator extends ContainerDerivativeDiscoveryDecorator { /** @@ -16,11 +21,10 @@ protected $moduleHandler; /** - * Creates a new instance. + * Constructs a new MigrateContainerDerivativeDiscoveryDecorator. * * @param \Drupal\Component\Plugin\Discovery\DiscoveryInterface $decorated - * The parent object implementing DiscoveryInterface that is being - * decorated. + * The parent object that is being decorated. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler. */ @@ -35,7 +39,7 @@ protected function getDeriver($base_plugin_id, $base_definition) { // Short-circuit attempts to instantiate derivers if the base provider is // not available. - if (isset($base_definition['provider']) && !in_array($base_definition['provider'], array('core', 'component')) && !$this->providerExists($base_definition['provider'])) { + if (isset($base_definition['provider']) && !in_array($base_definition['provider'], ['core', 'component']) && !$this->moduleHandler->moduleExists($base_definition['provider'])) { return NULL; } else { @@ -45,12 +49,2 @@ - /** - * Determines if the provider of a definition exists. - * - * @return bool - * TRUE if provider exists, FALSE otherwise. - */ - protected function providerExists($provider) { - return $this->moduleHandler->moduleExists($provider); - } - } diff -u b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php --- b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php +++ b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php @@ -57,7 +57,9 @@ * @covers ::getDefinitions */ public function testGetDefinitions() { - $migration_plugins = \Drupal::service('plugin.manager.migration')->getDefinitions(); + // Make sure retrieving all the core migration plugins does not throw any + // errors. + $migration_plugins = $this->container->get('plugin.manager.migration')->getDefinitions(); } }