Permalink

Thank you this helped me out a lot.

A helpful tip to anyone thinking of creating field collections on the fly to add to a node during a migration (using the migrate module):

Firstly, use the migrate module's prepare() method because what you need is the parent node to have already been created, and after it creates the parent node, it passes it as an object to the prepare() method automatically via the $node argument and you can use this in the setHostEntity() method - $field_collection_item->setHostEntity($this->destination->getEntityType(), $node);

The content of this field is kept private and will not be shown publicly.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.