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.

Comments

StatusFileSize
new1.43 KB

Here's a patch that should work with version 2.4 of the Migrate module.

This helped me out a lot. Thank you.

Status:Active» Needs review

StatusFileSize
new998 bytes

There's a slightly simpler way to implement the migration class--extend the MigrateSimpleFieldHandler that migrate provides. Patch attached.

Both approaches work for me, though.

Title:Field Handler for Migrate moduleField Handler for Migrate module (patch)

The patch in #4 works like a charm! Thanks becw!

Status:Needs review» Reviewed & tested by the community

Would be great to see this be brought into this module and also documented with the Migration module so that others know where it exists.

Works for me also. Please commit.

Status:Reviewed & tested by the community» Fixed

Committed and pushed to 7.x-1.x. Thanks!

Status:Fixed» Closed (fixed)

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

Might 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.

If you get the error I posted in #11, you can add the following to phone.migrate.inc to bypass it:

class MigrateSimpleFieldHandler {};
class MigratePhoneFieldHandler extends MigrateSimpleFieldHandler {
  public function __construct() {
    $this->registerTypes(array('phone'));
  }
}

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.

Category:feature» bug
Status:Closed (fixed)» Active

I received

Fatal error: Class 'MigrateSimpleFieldHandler' not found in sites/all/modules/phone/phone.migrate.inc on line 34

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.

$ grep -r 'class MigrateSimpleFieldHandler' *
modules/migrate/plugins/destinations/fields.inc:abstract class MigrateSimpleFieldHandler extends MigrateFieldHandler {

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

Same issue as comments 11-13 - I used the instruction in comment 12 and it seems to have resolved things.