When creating a hierarchical taxonomy, if a term's parent matches any other term, regardless of depth, it will be matched to that parent.
For instance, a CSV file containing:

Food, Chinese, Fried noodles
Food, Indian, Samosa
Animal, Chinese, Chicken

Becomes, after import:

Animal 	 
Food 	
    Chinese
        Chicken
        Fried noodle
    Indian
        Samosa

Comments

Daniel_KM’s picture

Assigned: Unassigned » Daniel_KM

Hi,

Duplicate terms are one of the main problem to resolve in taxonomies imports. Simple taxonomies have only one parent, but in your case, it seems "Chinese" has two parents. It's possible, but currently, taxonomy_csv doesn't know if you want above or :

Animal 
    Food 
        Chinese
            Chicken
            Fried noodle
        Indian
            Samosa

In fact, you should always indicate all the hierarchy for each term to avoid these type of problem:

Animal, Food, Chinese, Fried noodles
Animal, Food, Chinese, Chicken
Animal, Food, Indian, Samosa

or in short way:

Animal, Food, Chinese, Fried noodles
, , , Chicken
, , Indian, Samosa

Regards,

Daniel Berthereau
Knowledge manager

sliph’s picture

Sorry, I wasn't really clear.

I pass it:

Food, Chinese, Fried noodles
Food, Indian, Samosa
Animal, Chinese, Chicken

I want:

Animal
    Chinese
        Chicken
Food
    Chinese
        Fried noodle
    Indian
        Samosa

I get:

Animal
Food
    Chinese
        Chicken
        Fried noodle
    Indian
        Samosa

How I got around this issue:

Modified:

Food, Chinese, Fried noodles
Food, Indian, Samosa
Animal, Chinese, Chicken

to be:

Food, Food#Chinese, Fried noodles
Food, Food#Indian, Samosa
Animal, Animal#Chinese, Chicken

And then ran SQL against my drupal DB to remove everything before & including the # in Taxonomy. (This is just an example - I had about 150 taxonomy terms in a similar heirarchy)

Daniel_KM’s picture

Assigned: Daniel_KM » Unassigned

Hi,

Happy you've found a solution to import your terms.

In some cases, term "Chinese" may be difficult to use, unless articles are described by more than one term and users think to use more than one word to find something.

I 'm currently working on import of duplicate terms.

Daniel Berthereau
Knowledge Manager

Daniel_KM’s picture

Hi,

New release 6.x-4.1 of Taxonomy csv resolves this issue. It recognizes automatically this type of import and creates the good hierarchy.

Best regards,

Daniel Berthereau
Knowledge manager

Daniel_KM’s picture

Version: 6.x-3.1 » 6.x-4.1
Status: Active » Closed (fixed)