My use case is this:
I have a D5 to D7 migration. I'm migrating D5 node references to D7 entity references. The twist is that the node references are references to other nodes of the same type (parents). The content type is 'location' and the node reference field is 'field_location_parent'. 'field_location_parent' is also the name of the D7 entity reference field.
Here is the relevant code:
In migration constructor:
$this->addFieldMapping('field_location_parent','field_location_parent')
->sourceMigration($this->getMachineName()); // reference to another location
here is createStub()
protected function createStub(Migration $migration, array $source_id) {
$node = new stdClass();
$node->title = t('Stub for @id', array('@id' => $source_id[0]));
$node->body = t('Stub body');
$node->type = $this->destination->getBundle();
$node->uid = 1;
$node->status = 0;
node_save($node);
if (isset($node->nid)) {
return array($node->nid);
}
else {
return FALSE;
}
}
When I add thecreateStub() code above copied from Chickens and eggs to the migration class, I get a fatal error.
Stacktrace attached.
What am I missing?
Fixed
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.