I have two hierarchical vocabularies, Countries and Indicators, and two json feeds with terms:

countries:

name     id   parent_id
Europe   21   
Belgium  65   21

indicators:

name              id   parent_id
Demography        21   
Total Population  38   21

In Settings for Taxonomy term processor I have the first importer linked to vocabulary Countries, and the second to vocabulary Indicators. In both cases the parent_id is mapped to "Parent: GUID (parentguid)".

First I run the Countries importer, then the Indicators importer. Result:

Countries is imported correctly, with Belgium the child of Europe,

Indicators is imported incorrectly. Only Demography shows up.
In the database I see that the parent of Total Population is Europe.

So the importer will correctly note that the GUID of Demography is different from Europe, because they are mapped to different vocabularies. However in the parent mapping it fails.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gaele created an issue. See original summary.

gaele’s picture

Issue summary: View changes
gaele’s picture

Title: Importing two hierarchical vocabularies with overlapping id's » Error when importing two hierarchical vocabularies with overlapping id's
MegaChriz’s picture

Status: Active » Needs review
FileSize
4.32 KB

Hallo gaele!

Yes, this is definitely a bug. I've written a test to confirm the bug. I plan to come up with a fix later. The patch adds a method called "testParentTargetByGUID" to the FeedsCSVtoTermsTest class. This tests importing the same data to two vocabularies and asserts if the terms are mapped to the right parent by GUID. A test that asserts if terms are mapped to the right parent by name should be added as well.

Setting issue status to "Needs review" so the testbot will execute tests, but it needs work because the fix is not yet included.

Status: Needs review » Needs work

The last submitted patch, 4: feeds-parent-term-2556461-4-tests-only.patch, failed testing.

MegaChriz’s picture

Version: 7.x-2.0-beta1 » 7.x-2.x-dev
Status: Needs work » Needs review
FileSize
9.15 KB

This patch should fix the issue. It also adds a similar test for finding the right parent term by name, for which no bug exists. There was only a bug for finding the right parent term by GUID.

gaele’s picture

Status: Needs review » Reviewed & tested by the community

Dankjewel :-)

  • MegaChriz committed d0ac307 on 7.x-2.x
    Issue #2556461 by MegaChriz: Fixed importing two hierarchical...
MegaChriz’s picture

Status: Reviewed & tested by the community » Fixed

Bedankt voor het testen. :) De patch in #6 is gecommit.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.