I have a node type called artwork, each node allows 3 CCK content_taxonomy fields which use the same vocabulary. I want the values to be stored in the core taxonomy ('term_node' table).

There are occasions where each field might have the same value - in this case it is fine for the term to be added to the 'term_node' table only once, but in this situation I get an error such as the one below:

user warning: Duplicate entry '13-2' for key 1 query: INSERT INTO term_node (nid, vid, tid) VALUES (2, 2, 13) in /Users/alistairmcclymont/Sites/j6/modules/taxonomy/taxonomy.module on line 694.

I do have a valid reason I believe for wanting duplicate entries - the node has 3 images, each one has a 'medium' term to be added, all 3 images can have the same medium.

Comments

ambo’s picture

Category: feature » bug

I got that problem too.

My scenario is a node with multiple autocomplete content-taxonomy textfields. On each save I get the error-report from above for every single field which is not empty, even if i add new terms (so it couldn't be duplicate).
So after a bit of testing I am sure that content taxonomy is trying to save the terms twice or did not remove them from the node after saving...

could that be possible?

regards - andreas

maedi’s picture

I'm also running into this problem, I have multiple CT fields pointing to the one Vocab and run into the same error:
user warning: Duplicate entry '390-652' for key 'PRIMARY' query: INSERT INTO term_node (nid, vid, tid) VALUES (264, 652, 390) in /var/www/html/modules/taxonomy/taxonomy.module on line 694.

mh86’s picture

Status: Active » Fixed

this has been fixed, see #375789: same taxonomy, 2 terms, sql warning for more information

maedi’s picture

Wonderful. Thank you.

Status: Fixed » Closed (fixed)

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