Cannot create new single-hierarchy terms
javanaut - October 17, 2005 - 17:33
| Project: | Drupal |
| Component: | taxonomy.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
When adding new terms to a vocabulary with single hierarchy (it was originally created with hierarchy disabled, but I don't know if that matters), new terms do not appear. For whatever reason, terms with a record in the term_hierarchy table will appear, but new terms being created don't have a term_hierarchy record for them.
I suspect that the taxonomy_get_tree function that joins against term_hierarchy table as an inner join is what excludes the new terms. If I manually create a record in term_hierarchy with parent=0, they appear.

#1
This is an issue with the new form api changes to taxonomy module. The old form always created an array by appending '][' to the form parent name and taxonomy_save_term always exepected an array in $edit['parent']. I have attached a patch which corrects taxonomy_save_term to accept $edit['parent'] as a single value.
#2
Patch still applies and I have tested as many basic taxonomy combinations that I can think of and this fixes all single parent term additions.
So +1 from me.
#3
+1 I just tested the patch, too and it is working for me.
Thanks!
#4
+1, looks good.
#5
This patch was applied when the admin help update was committed.
http://cvs.drupal.org/viewcvs/drupal/drupal/modules/taxonomy.module?r1=1...
#6