Duplicate key warnings generated on node_save()

mikeryan - January 11, 2009 - 18:40
Project:Primary Term
Version:6.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community
Description

Not sure why this doesn't happen when saving a node edit form, but with a programmatic node_save() of a node with a primary term assigned, duplicate key warnings on term_node are generated. As the comments say:

// taxonomy_node_save() allows $node->taxonomy to contain tids,
// term objects, or arrays of tids (keyed by vocabulary).  So,
// we can add the PT tid to the end of the array.

But, the code is only handling raw tids and arrays, not objects. The attached patch addresses this.

AttachmentSize
primary_term.module.patch435 bytes

#1

moshe weitzman - January 12, 2009 - 16:05
Status:active» reviewed & tested by the community
 
 

Drupal is a registered trademark of Dries Buytaert.