Steps to reproduce:
1) add vocabulary at admin/structure/taxonomy/add named Tags
2) navigate admin/structure/taxonomy/tags and click "Add term" - admin/structure/taxonomy/tags/add
3) click "List" to return back to admin/structure/taxonomy/tags

There's no term in list!

This caused by using taxonomy_get_tree() in taxonomy_overview_terms()

Newly created term have no records in {taxonomy_term_hierarchy}

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost’s picture

Title: Taxonomy terms list broken » Taxonomy terms list broken, term add/edit forgets it's parent
Status: Active » Needs review
Issue tags: +Quick fix
FileSize
753 bytes

When term is edit default parent is not set

Simple fix

andypost’s picture

FileSize
2.01 KB

Now with test

yched’s picture

Priority: Normal » Critical

Bumped into that as well. Raising to critical.

I'll let catch or bangpound review the fix, though.

catch’s picture

Status: Needs review » Reviewed & tested by the community

I really dislike that we use taxonomy_get_tree() in taxonomy_overview_terms() but that's not for this issue to fix. Patch itself looks good.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

andypost’s picture

mikeryan’s picture

Hold on a sec... taxonomy_get_tree() does an inner join to taxonomy_term_hierarchy, so it appears that every term is expected to have a row in taxonomy_term_hierarchy, correct? So, shouldn't taxonomy_term_save enforce this? I'll see if I can throw together a patch...

andypost’s picture

@mikeryan and already commited patch makes adding this row for every term

mikeryan’s picture

If you mean the patch you submitted in comment #2, that only fixes it for terms created through the UI - my point is that programmatic creation does not benefit from this patch, it needs to be in taxonomy_term_save().

andypost’s picture

@mikeryan if you saving terms from custom module you should care about setting $term->parent because only developer knows about own data format.

Status: Fixed » Closed (fixed)
Issue tags: -Quick fix

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