Closed (duplicate)
Project:
Category
Version:
5.x-1.1
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Feb 2007 at 22:36 UTC
Updated:
7 Apr 2007 at 20:53 UTC
I keep getting this error when I submit a story using the Category module.
user warning: Duplicate entry '1-34' for key 1 query: INSERT INTO term_node (nid, tid) VALUES (34, 1) in /home/<my drupal directory>/includes/database.mysql.inc on line 172.
The hierarchy I'm attempting to set up is for a site that reviews perfumes and related accoutrements. I want perfume reviews to have a definite category: Review -> Perfume, but also to have free tagging below this level to relate different manufacturers/characteristics/types to each other.
Here's how I have the container system set up (square brackets represent containers):
[ARTICLES]
-[REVIEWS] (required)
-Other Stuff
-Perfume
-[TYPES] (hidden, free-tag)
So, what could be causing this? I remember that I tried to uninstall Category at one point and go back to Taxonomy, but that I couldn't or didn't want to, and reversed it.
Comments
Comment #1
ianchan commentedSame issue for me. I looked at the table category_node and the cids are inserted correctly. However, in the term_node table the query inserts the tid of 1 whereas it should have inserted 8 and 48 for the node in question. I think "duplicate entry" is coming up because it tries to insert the tid of 1, twice, for the same node.
The Drupal log error mesage is "Duplicate entry '1-299' for key 1 query: taxonomy_node_save INSERT INTO term_node (nid, tid) VALUES (299, 1) in /var/www/htdocs/360/includes/database.mysql.inc on line 172."
I marked this critical as our users are creating content and then cannot find the content after posting. I tired to downgrade to 5.x.1.1 and the same issue occurs.
Thanks for your help.
Comment #2
green monkey commentedDrupal 5.1
same error
Comment #3
ianchan commentedThe solution posted on http://drupal.org/node/121399 resolved the issue for our Drupal 5.x install. I checked the term_node table and new pages created after the fix are inserted with the correct tid.
Comment #4
sjh-1 commentedI have added a patch that should fix this issues at #19 in http://drupal.org/node/87669#comment-225000 It seems to be caused by assigning the category structure to the taxonomy field, without adding the tid element to the structure.
Comment #5
bdragon commentedMarking as duplicate of http://drupal.org/node/87669.
Thank you for your report.
--Brandon