I was trying to import a node reference field and I got everything set up correctly via Table Wizard and a relationship using the generated node_map table. In my table analysis, I set up the correct pointer for pulling in the necessary node id into my node reference field, but during the migration, the field wasn't being populated at all. I noticed that the node field doesn't appear to be being named correctly for some reason. The data should actually be going into $node->field_release[0]['nid'], but it's actually going into $node->field_release_nid. I used HOOK_migrate_destination_prepare_node to fill in the correct field:

$node->field_release[0]['nid'] = $node->field_release_nid;

I was thinking that this is something that should work easily out of the box and shouldn't require the use of the hook, but I could be wrong.

Comments

attheshow’s picture

Status: Active » Fixed

I think this issue was fixed by your commits on April 6th. Thanks Mike.

frankcarey’s picture

"Table Wizard and a relationship using the generated node_map table". I tried to do this with one of these tables and it gave me an error about no primary key for the table. I think i have an updated codebase, can you elaborate how you did this?

attheshow’s picture

Frank,

Please check out my comment#13 over at the TW issue #420002: Error - Could not analyze node_map table to see what I did to get it to work. Also, if you could speak up in that issue too and let Mike know that you're having the same issue, that couldn't hurt.

frankcarey’s picture

oh cool. are these created in tw automatically now? ..nm i'll check the tw queue

Status: Fixed » Closed (fixed)

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