Running drupal 6.15. I have a very long list of terms for one vocabulary in taxonomy. After reading a bit up on it, i decided i'd like to try cutting it up.

Rather than one by one deleting terms (which, btw, why isn't their just a checkbox delete on the terms list next to each one?) and recreating them all, i thought i'd transfer them via the mysql database.

Basically i tested one term by doing the following:

phpmy admin > my database > term_data
found a term i'd like to move from one vocabulary to another (both exist, the destination directory is new and empty).
Changed the vid to match the new vocabulary's vid id.
Saved.

No longer shows in the original directory as desired, but does not show up in the new directory either.
flushed all the caches, opened admin menu, ran cron, still does not show.
Created a new term, saw the correct vid in the database (same as the one i applied to the already existing term) and deleted it.

Is there a relationship in another table i'm not aware of? Some step i've missed?

thanks in advance for your help!

***SOLVED***
The table term_hierarchy needs the first node of a vocabulary's term to reference 0 as its "parent" field. Since it was in an existing hierarchy it was referring to a parent that did not exist in the new vocabulary.

Drupal, rather than throw an error (kinda good, but kinda bad) just did not display it or its sub-terms due to this inconsistency.

Hope that helps somebody in the future!

Comments

Cybergarou’s picture

Drupal is never going to check for errors caused by people editing the database directly. The inconsistency you described can't occur during the normal use of Drupal so we don't waste time looking for it.

Drupal has been around long enough that there are utility modules for just about everything you can think of doing. If you find yourself changing the database directly you are likely doing things the hard way. In this case, if you ever need to make widespread changes to your taxonomy again, consider using the Taxonomy Manager module. (That's the most powerful one, but there are multiple modules for modifying the taxonomy.)