Closed (duplicate)
Project:
Category
Version:
master
Component:
Wrapper modules
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 May 2006 at 19:41 UTC
Updated:
7 Apr 2007 at 21:05 UTC
I've installed just the core Drupal -- no additional modules yet. I've created multiple categories and when I create a blog entry and assign it 1 or more categories, I get the following error:
user warning: Duplicate entry '3-7' for key 1 query: INSERT INTO term_node (nid, tid) VALUES (7, 3) in /var/www/html/includes/database.mysql.inc on line 120.
When I use free tagging, this error doesn't occur. Please provide a fix.
Comments
Comment #1
killes@www.drop.org commentedPlease provide more info, how do you assign the categories?
Hardly critical
Comment #2
magico commentedTo old and nobody else complained...
Comment #3
(not verified) commentedComment #4
kristi wachter commentedI've discovered this happening again, using 4.7.3. I had thought it was related to Category, but seeing this old report under Taxonomy, I think it might be a taxonomy issue.
I have:
Drupal 4.7.3
Category (the 4.7 Oct 1 version)
Taxonomy Wrapper turned on
When I use an older Category release (from Aug 27?), my system works fine.
When I upgrade to the more recent Category release (4.7, Oct 1), I seem to be able to reproduce the following pretty reliably:
* Create a node (in my case, a CCK node)
* Assign it two categories from different containers (in my case, one happens to allow freetext entry, but I doubt that's important)
* Save the node
* Notice that, although the node appears on my main page "list all new nodes" view, it does NOT appear on the relevant category page for either of the two categories assigned to it
* return to the node, click Edit, and save it again (without making any changes)
* consistently get the following error: "
Duplicate entry '1-273' for key 1 query: INSERT INTO dr_term_node (nid, tid) VALUES (273, 1) in /mysite/includes/database.mysql.inc on line 120." (Yes, my database tables are prefixed.)
In my tests, it seems to always be that the tid value is 1.
If I back off to the Aug 27 version of Category, the issue goes away. I create a new node just as above, it appears properly on the two specified category pages.
I'm reporting this here instead of in Category because it seems to have come up for regular Taxonomy users in the past. I'll leave a note over at Category, too.
Thanks,
Kristi
Comment #5
Henrik Opel commentedLooks like similar symptoms but different cause - see:
http://drupal.org/node/87669
@Kristi:
I had the same problem (tid always 1 in term_node, causing duplicate warning when saving again) and tracked it down to a problem in the taxonomy wrapper of the category module. However this does not explain explain why the new node does not show up on your category pages, since they shouldn't use the taxonomy tables at all. It would only explain this if you use a view there (either 'native' or via category_views). Is this the case?
I'm also surprised that your Aug 27 setup does not show this behaviour - could you provide the version number of the 'taxonomy.module.copyme' file from that setup? And if you take a look at the term_node table of that setup directly in the database, does it have proper tid entries (insted of all 1)?
Comment #6
kristi wachter commentedThanks for the reply, HeO.
Yes, I use a view on my category pages - sorry, I should have said so.
The version info from the Aug 27 taxonomy wrapper that does seem to work for me:
$Id: taxonomy.module.copyme,v 1.21 2006/07/27 14:28:15 jaza Exp $
If I look at the term_node table for the installation that works well for me, the one with the Aug 27 version of category, the tid entries are correct - a variety of numbers, no 1s in sight.
Thanks,
Kristi
Comment #7
inforeto commentedI have one site where term_node tid is 1 for all rows (108 entries)
in sequences table:
term_data_tid is 651 and node_nid is 661
category.module is being used
Comment #8
inforeto commentedLooking further i imagine this tid=1 could be the reason all my nodes are uncategorized while using views filtered by taxonomy term ID.
My issue was here, related to term ids with category: http://drupal.org/node/89545
I moved into exposing category to views to avoid that but the duplicated entry error persists.
Comment #9
Henrik Opel commentedKristi: Thanks for providing the infos! (and sorry for the late reply, been away on a long weekend :)
I'm still surprised, since the 1.21 version has no differences to the current one that would explain why it works (or why the current one wouldn't). This questions my proposed fix, so I guess I'll have to take a closer look ...
Comment #10
bejam commentedI am getting this too, but also another strange effect. Using og, views, and category (with taxonomy wrapper). When creating a new node that also auto-creates a category (using a free-typed tag) my subsequent view onto all the og nodes of that type breaks. Infact all of my views related to organic groups (path starting og/view/) break.
To be clear am not using a view in a category, but just a view, keeping the path as above for the og_group_context. If i clear the cache then the problem goes away, and stays away when creating another new node.... unless the new node also creates a new category. Am using latest cvs 4.7 branch.
Have also tried switching off caching completely and it doesn't help... have to do a truncate cache to fix the problem.
Comment #11
bdragon commentedYoinking this issue.
It's a wrapper problem.
And...
Marking as duplicate of http://drupal.org/node/87669.
Thank you for your report.
--Brandon