First off thanks so much for an awesome module! I am learn migrate and php at the same time so this may be an easy question for you.

I am trying to do a very simple node reference to content I already have in the drupal site. I have the related nid in my migrate table already in a column called 'node_id' and am pointing it to a node ref field called 'field_bucket_child_ref'.

However this field does not populate. (I am using the dropdown widget if that information helps at all)

<?php
    $this->addFieldMapping('field_bucket_child_ref', 'node_id');

?>

Is there some other preprocessing that needs to be done or something?

Thanks for the help!

Comments

mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)

Sorry for the slow response, I seem to have missed this issue initially...

I'm a little unclear on what you mean by "I have the related nid in my migrate table already in a column called 'node_id'"... Are you saying that the source query for your migration contains the destination nid for your target? How exactly are you accomplishing that? Usually one's source query contains the ID of the target content from the original site, and to get the right Drupal node ID you need to do:

$this->addFieldMapping('field_bucket_child_ref', 'node_id')
     ->sourceMigration('Child');

I.e., you tell Migrate that the referenced node was migrated by ChildMigration, so refer to its mapping table to translate the node_id in the source to the right Drupal nid.

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)