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

ccourtne - October 20, 2005 - 14:13
Status:active» patch (code needs review)

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.

AttachmentSize
addtermfix.patch611 bytes

#2

asimmonds - October 27, 2005 - 08:21

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

javanaut - October 27, 2005 - 19:57

+1 I just tested the patch, too and it is working for me.

Thanks!

#4

Robin Monks - October 30, 2005 - 19:01
Status:patch (code needs review)» patch (reviewed & tested by the community)

+1, looks good.

#5

asimmonds - November 16, 2005 - 02:17
Status:patch (reviewed & tested by the community)» fixed

This patch was applied when the admin help update was committed.
http://cvs.drupal.org/viewcvs/drupal/drupal/modules/taxonomy.module?r1=1...

#6

Anonymous - November 30, 2005 - 02:20
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.