The parent field from taxonomy_term_hierarchy is necessary for migrating vocabularies that have a nested hierarchy. This was clearly considered with the base query that runs. You can see that it sorts by "th.parent asc" in order to ensure that parents are created before the children. But, the query itself leaves out the parent id, making it impossible to generate the hierarchy.

Current D7 Base query for taxonomies

SELECT DISTINCT td.tid AS tid, td.name AS name, td.description AS description, td.weight AS weight, td.format AS format
FROM 
taxonomy_term_data td
LEFT OUTER JOIN taxonomy_term_hierarchy th ON td.tid=th.tid
INNER JOIN taxonomy_vocabulary v ON td.vid=v.vid
WHERE  (v.machine_name IN  ('all_carrefour')) 
ORDER BY th.parent ASC

The parent field needs to be added to the query as well in order for the taxnomy migration to have source data to properly map to the destination parent field. The query should look like this when complete:

Proposed change to D7 Base query for taxonomies

SELECT DISTINCT td.tid AS tid, td.name AS name, td.description AS description, td.weight AS weight, td.format AS format, th.parent AS parent
FROM 
taxonomy_term_data td
LEFT OUTER JOIN taxonomy_term_hierarchy th ON td.tid=th.tid
INNER JOIN taxonomy_vocabulary v ON td.vid=v.vid
WHERE  (v.machine_name IN  ('all_carrefour')) 
ORDER BY th.parent ASC

Comments

netw3rker created an issue. See original summary.

netw3rker’s picture

Status: Active » Needs review
StatusFileSize
new593 bytes

Here's a patch to resolve this.

anrikun’s picture

Status: Needs review » Reviewed & tested by the community

Patch works. Thanks!

rodrigoaguilera’s picture

This is an obvious bug. I also tested it and it works. Please commit it