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 |
Jump to:
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.
| Attachment | Size |
|---|---|
| primary_term.module.patch | 435 bytes |

#1