This patch allows CCK and other data to be injected into $user->'profile|foo' attributes directly in hook_migrate_prepare_user(), and then passed straight into the $node->foo attributes of content_profile nodes on completion.

I've been using this code myself on a site-in-progress for some time. I wrote it before this code was split out into migrate_extras. I've created this patch against the latest code in migrate_extras, however.

As the comments in my patch explain, the patch lets you do something like this in hook_migrate_prepare_user():

$key = 'profile|field_cck_foo';
$user->$foo = $cck_data;

And then content_profile_migrate_complete_user() automatically adds that to the $node object, as:

$node->field_cck_foo;

Very useful! Hope this can make it in.

CommentFileSizeAuthor
migrate_extras_content_profile.patch2.5 KBJaza

Comments

frankcarey’s picture

Status: Needs review » Postponed (maintainer needs more info)

I actually import content_profiles in their own step, so I'm not very familiar with the content_profile code that we just pulled in from the migrate module. Maybe you can explain this to me a little better? I thought that content_profile integration already exposes all of possible node fields already.

moshe weitzman’s picture

Title: Support migrating CCK data into content_profile nodes » Remove content_profile integration from 2.x
Component: Code » Migrate Extras Features
Assigned: Jaza » moshe weitzman
Status: Postponed (maintainer needs more info) » Needs review

I am implementing a 2.x migration now and I also do content_profile as its own node migration and it works fine. I recommend removing content_profile integration from 2.x branch. It is not ported anyway.

moshe weitzman’s picture

Status: Needs review » Fixed

I went ahead and removed the content_profile integration from 2.x.

Status: Fixed » Closed (fixed)

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