Auto-registration - that is, having the mere creation of a migration class result in the registration of a migration with that class and with a machine name consisting of the pre-Migration part of the class name, without taking any explicit action to register it - was deprecated and de-emphasized in Migrate 2.5 (removed as a side-effect of a cache clear). I want to remove it entirely for Migrate 2.6, as well as clarifying the relationship between registering and constructing migrations.

The auto-registration support has long been the source of chicken-and-egg issues in Migrate, and the situation is going to get worse with work like #1896096: DB storage of field mappings, where we really need to be very explicit about when and how field mappings get stored in the database vs. defined in code. Besides the auto-registration, migrations registered via hook_migrate_api() get reregistered (thus any arguments get updated in migrate_status) as a side-effect of many migration operations (basically, anything which calls migrate_get_module_apis(TRUE)). It will save many a WTF going forward if a migration is only (re)registered when explicitly asked - a drush migrate-register command or Register button in the UI.

Comments

mikeryan’s picture

Issue tags: +Migrate 2.6

The fundamental work here is committed to the wizard_api branch. Leaving open for now, I will be reviewing the basic registration/construction code and seeing what else can be removed or at least simplified.

mikeryan’s picture

Status: Active » Fixed

I think we've done enough here - any future optimizations to the registration process should be opened as new issues.

ericras’s picture

A note that the commit related to this issue resulted in this issue for me: #1968274: Removing auto-registration broke some addFieldMapping() calls

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