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

Greg__’s picture

Status: Active » Closed (works as designed)

Ok, 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.