Parent terms aren't recursively checked

sliph - May 1, 2009 - 18:02
Project:Taxonomy CSV import/export
Version:6.x-3.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

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

#1

Daniel_KM - May 11, 2009 - 09:54
Assigned to:Anonymous» 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

#2

sliph - May 11, 2009 - 10:58

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)

#3

Daniel_KM - May 11, 2009 - 14:19
Assigned to:Daniel_KM» Anonymous

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

#4

Daniel_KM - August 12, 2009 - 12:28

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

 
 

Drupal is a registered trademark of Dries Buytaert.