Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
After adding a stub (thanks to https://drupal.org/node/1013506),
protected function createStub(Migration $migration, array $source_id) {
$node = new stdClass();
$node->title = t('Stub for @id', array('@id' => $source_id[0]));
$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;
}
}
I got the following error :
Migration failed with source plugin exception: Argument 1 passed to ProductPage::createStub() must be an instance of Migration, null given, called in C:\wamp\www\migration\sites\all\modules\custom\migrate_script\node.inc on line 87 and defined File C:\wamp\www\migration\sites\all\modules\custom\migrate_script\node.inc, line 5062
The script seems to import a few Content (Stub also) before having this error.
Any idea where this could come from ?
Comments
Comment #1
Greg__ CreditAttribution: Greg__ commentedOk, my bad.
I had another createSub function in a parent class which is not compatible with the way i used it in the child function.