Problem/Motivation
When migrate_default_content generates migration plugin definitions, it can overwrite properties from an existing custom migration YAML definition with the same migration ID.
This means custom properties such as migration_group can be lost, causing generated default-content migrations to appear under the implicit Default (default) group instead of the group explicitly set by the site.
Proposed resolution
Pass the existing migration plugin definitions into MigrationGenerator::generateMigrations().
When a generated migration has a matching existing plugin definition, merge the existing custom definition back over the generated definition using array_replace_recursive(). This preserves generated defaults while allowing explicit YAML properties, such as migration_group, to override them.
Issue fork migrate_default_content-3587708
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
joelpittetAdded a test to show the fix actually fixes things.
AI-Generated: Yes (AI was used to help draft, review, and refine this issue and MR, including the test. I edited and omitted parts of the generation, and steered the test into the shape it is, I installed ddev-drupal-contrib locally to run tests locally before submitting them, and manually tested with my real-world problem)
Comment #4
joelpittetThe YAML in the test started as a separate file, but I inlined it because I was afraid of loading paths in gitlab-ci, if that is a concern I am happy to refine and bring back the actual YAML file as a fixture... or ditch the test if you don't want tests here (this would be the first for the module)...