Defining a source plugin type in a migration_group is broken in Drupal 10.3

Created on 23 August 2024, 7 months ago
Updated 4 September 2024, 6 months ago

Problem/Motivation

In this issue ( https://git.drupalcode.org/project/drupal/-/commit/1c279bde183ca8b15efd0... ), a hook_migration_plugins_alter() was added in core action module, which executes the following code:

$source_plugin = \Drupal::service('plugin.manager.migration')
  ->createStubMigration($migration)
  ->getSourcePlugin();

When this hook calls getSourcePlugin() before the migration group configuration have been merged with the migration.
If you have, for example, definded the source plugin in the migration group shared configuration, it will fail, because the configuration is missing the plugin key in the source.

Steps to reproduce

Import the attached configuration files for the migration_group, and the migration instance.
Execute "drush migrate:status --names-only"

The following error should appear:

The "" plugin does not exist. Valid plugin IDs for Drupal\migrate\Plugin\MigrateSourcePluginManager are: embedded_data, empty, migrate_source_days_before, url, table

Proposed resolution

I am not sure what the best approach should be for this. Maybe the configuration merge with the group should be performed before.

I will try have a better look at this issue on the weekend.

💬 Support request
Status

Needs review

Version

6.0

Component

API

Created by

🇪🇸Spain guiu.rocafort.ferrer Barcelona

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024