Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Because this module establishes a new field type, the Migrate module is unable to store any values in Phone fields used as endpoints in field mappings. Adding a child class of MigrateFieldHandler and an implementation of hook_migrate_api() should enable migration of Phone fields.
Comment | File | Size | Author |
---|---|---|---|
#4 | 1741196-4-phone-migrate_class.patch | 998 bytes | becw |
#1 | phone-migrateFieldHandler-1741196-1.patch | 1.43 KB | jpklein |
Comments
Comment #1
jpklein CreditAttribution: jpklein commentedHere's a patch that should work with version 2.4 of the Migrate module.
Comment #2
jrsinclair CreditAttribution: jrsinclair commentedThis helped me out a lot. Thank you.
Comment #3
jrsinclair CreditAttribution: jrsinclair commentedComment #4
becw CreditAttribution: becw commentedThere's a slightly simpler way to implement the migration class--extend the
MigrateSimpleFieldHandler
that migrate provides. Patch attached.Both approaches work for me, though.
Comment #5
becw CreditAttribution: becw commentedComment #6
nerdcore CreditAttribution: nerdcore commentedThe patch in #4 works like a charm! Thanks becw!
Comment #7
mgiffordWould be great to see this be brought into this module and also documented with the Migration module so that others know where it exists.
Comment #8
jonathan_hunt CreditAttribution: jonathan_hunt commentedWorks for me also. Please commit.
Comment #9
cweagansCommitted and pushed to 7.x-1.x. Thanks!
Comment #11
philsward CreditAttribution: philsward commentedMight want to add a page or system error that specifies you need the dependency of the migrate module in order to make this work.
Without the migrate module, I received this error on the CCK content migrate page:
Fatal error: Class 'MigrateSimpleFieldHandler' not found in /home/user/public_html/sites/all/modules/contrib/phone/phone.migrate.inc on line 34
Unless I am completely missing something, I thought the CCK field migrate was the "proper" method for upgrading from D6 -> D7... This is the first time I've run into a field module needing the migrate module in order to upgrade.
Comment #12
philsward CreditAttribution: philsward commentedIf you get the error I posted in #11, you can add the following to phone.migrate.inc to bypass it:
put class MigrateSimpleFieldHandler {}; above the class MigratePhoneFieldHandler extends MigrateSimpleFieldHandler line.
I don't know the first thing about programming and tried that on a hunch. I personally added this line after installing the Migrate module and migrating my phone fields. After I uninstalled the Migrate module, the error came back and I needed a way to access the /admin/structure/content_migrate page. The above code let me bypass it with no problems.
Comment #13
DarrellDuane CreditAttribution: DarrellDuane commentedI received
in the latest version of the code as well when I went to example.com/admin/structure/content_migrate.
The class MigrateSimpleFieldHandler is defined in the Migrate module, which wasn't enabled (or required to be enabled for the Content Migrate module.
There are a few options here that I see:
- We can submit a new bug report to the content_migrate module and ask them to require the migrate module be enabled.
- We can add code that defines the MigrateSimpleFieldHander class if its not defined.
-We can use a different class to support this
The first seems like a best option but I don't know if content_migrate people would be willing to do this. I'll submit a quick feature request seeing if they would.
Here is the issue for content_migrate: http://drupal.org/node/1980554
Comment #14
arianek CreditAttribution: arianek commentedSame issue as comments 11-13 - I used the instruction in comment 12 and it seems to have resolved things.