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.
Comment | File | Size | Author |
---|---|---|---|
#6 | feeds-parent-term-2556461-6.patch | 9.15 KB | MegaChriz |
#4 | feeds-parent-term-2556461-4-tests-only.patch | 4.32 KB | MegaChriz |
Comments
Comment #2
gaele CreditAttribution: gaele commentedComment #3
gaele CreditAttribution: gaele commentedComment #4
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedHallo 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.
Comment #6
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedThis 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.
Comment #7
gaele CreditAttribution: gaele commentedDankjewel :-)
Comment #9
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedBedankt voor het testen. :) De patch in #6 is gecommit.