Download & Extend

Class registration for Migrate 2.5 or later

Project:Link
Version:7.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

It's a long story, but due to fatal errors in certain environments triggered by Migrate's automated registration of migration and handler classes, as of Migrate 2.5 it will be possible to disable auto-registration, and any module implementing migration or handler classes should explicitly register them via hook_migrate_api() to continue working when auto-registration is disabled. Adding this registration will have no effect with Migrate 2.4 or earlier.

AttachmentSize
migrate_class_registration_link.patch365 bytes

Comments

#1

Hey Mike,

I may be wrong but I think the api hook needs to move into link.migrate.inc

I couldn't get it working until i made this change.

Thoughts?

I can reroll if you think it needs to be changed.

#2

It shouldn't technically be necessary, any hook should work in .module, but yes, using .migrate.inc is a best practice. I wanted to keep this issue purely focused on the registration, but moving the hook to .migrate.inc would be a bonus.

#3

Status:needs review» reviewed & tested by the community

Here's a patch that moves the migrate api hook into link.migrate.inc.

I was having some caching issues before, and can now confirm that the patches work as expected.

Setting to RTBC somewhat tentatively coz I supplied a patch, but its a pretty small one and i have tested it.

Maintainers can choose between moving or not moving the api hook.

AttachmentSize
migrate_class_registration_link-1832754-3.patch 940 bytes

#4

Note that I've posted a consolidated patch in #1010850: Update MigrateFieldHandler to work with migrate-7.x-2.4 and later that would supercede this.

#5

Status:reviewed & tested by the community» fixed

all good!

#6

Status:fixed» closed (fixed)

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

nobody click here