Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeryan’s picture

Attached patch depends on the core patch at #2302307: Support shared configuration between migrate groups. It adds a migration group for the beer example, and makes the migrate-status and migrate-import drush commands group-aware.

mikeryan’s picture

FileSize
2.08 KB

Patch updated to work with latest core patch at https://www.drupal.org/node/2302307#comment-9796695

mikeryan’s picture

Status: Postponed » Active

Per #2302307: Support shared configuration between migrate groups, we're going to pull the MigrationGroup class itself into migrate_plus for now.

mikeryan’s picture

Component: Examples » Miscellaneous
Status: Active » Needs review
FileSize
15.57 KB

Here's the patch, including the basic group support itself. Bit of a problem though - because we need to add the ability to merge shared configuration into migrations, we need to extend the MigrationStorage class, which we do with a hook_entity_type_alter() (to replace migrate's own MigrationStorage with our own). The problem is, migrate_drupal is also replacing MigrationStorage with its own version (improperly, I believe: #2499173: migrate_drupal highjacks the Migration and MigrationStorage classes) - this means that you can't have both migrate_drupal and migrate_plus enabled without one breaking the other. In particular, it means incorporating group support into migrate_upgrade, which is a major POC for getting the groups into core (where they won't need the alter hook), won't work. Chicken, meet egg...

mikeryan’s picture

Digging a bit deeper, maybe we can do hook_migration_load() instead of extending doLoadMultiple() to merge our configuration. And maybe migrate_drupal can use the hook as well... I hate resorting to hooks in an object-oriented design (separating code from its class context), but it may be necessary in this case.

mikeryan’s picture

FileSize
6.01 KB
12.83 KB

Yep, that works. It's fine with me to use the hook here, it won't be necessary when this goes into core because we'll put the configuration merge code directly into Migrate's MigrationStorage.

  • mikeryan committed 3ef1e1d on 8.x-1.x
    Issue #2455575 by mikeryan: Add support for migration groups
    
mikeryan’s picture

Status: Needs review » Fixed

Done!

Status: Fixed » Closed (fixed)

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