Closed (fixed)
Project:
Migrate
Version:
7.x-2.6
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 Feb 2015 at 15:20 UTC
Updated:
14 Mar 2015 at 16:16 UTC
Jump to comment: Most recent
Comments
Comment #1
koffer commentedComment #2
koffer commentedComment #3
mikeryanSo, when you're creating the terms as a side-effect of mapping them directly in a node migration (as opposed to migrating them in a separate term migration and referencing that migration), there's no direct way to set the parent - i.e., you need to do some manual work. One way would be to map the capital directly, which will create it without a parent, then in your migration's complete() function pull the term from the node object, see if it has a parent, and if not create the parent (state) term and set the parent on the term object.
Another option is to make a separate term migration that reads the same Excel file - it can create the terms and their hierarchy directly through straight-forward mappings, then your node migration can reference that migration.
Comment #4
mikeryanComment #5
koffer commentedThanks for your answer mikeryan. Right know We are writing a node to explain how we solve the problem:
How to create nodes with hierarchical terms from excel
https://www.drupal.org/node/2448189