Closed (cannot reproduce)
Project:
Taxonomy Defaults
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Feb 2009 at 15:28 UTC
Updated:
11 Dec 2010 at 05:13 UTC
Jump to comment: Most recent file
Comments
Comment #1
bradweikel commentedI'm unable to reproduce this. Could you describe your setup in more detail? On a fresh install, how would I create this scenario?
Also, are you using any other taxonomy/cck crossover modules, like cck_taxonomy?
Comment #2
farald commentedIn addition to the two above, I use
taxonomy_breadcrumb
taxonomy_image
taxonomy_manager
hiearchical_select
no crossovers cck/taxonomy
Ive tried disabling taxonomy_defaults on the main installation, the error goes away.
i have now set up a fresh install aiming to reproduce the error.
-Installed comment_cck and taxonomy_defaults.
-Created a userreference field on story, allowed it to be edited by comment_cck.
-Created a node, commented on it while editing the userreference field.
Works fine here too, no success in reproducing the error.
I will dig a little deeper in my main installation tomorrow to see if there are conflicts i have overseen.
Comment #3
anarchivist commentedI'm seeing the same bug when I'm using Views Bulk Operations. When I run any of the operations on a set of selected nodes exposed through the view, I get a message like the following:
user warning: Duplicate entry '55-51' for key 1 query: INSERT INTO term_node (nid, vid, tid) VALUES (51, 51, 55) in /www/modules/taxonomy/taxonomy.module on line 702.In my case, taxonomy_defaults is using taxonomy_defaults_nodeapi() as I haven't exposed the taxonomies to the content types directly.
Comment #4
NickSI commentedProblem seems to appear when node_save is issued from the code (i.e. after Views Bulk Operations action). In this case node's taxonomy property has tid as index, not vid. In this case taxonomy_defaults_nodeapi would not simple override exiting tid element, but add a new one even if default tid already exists.
Attached quick patch I am not really happy with, but at least it gets rid of this error.
Comment #5
farald commentedComment #6
anarchivist commentedYes, the patch works for bulk operations with no warnings, but resaving nodes that have already had their default terms assigned causes the following warning to appear:
warning: current(): Passed variable is not an array or object in /www/sites/all/modules/taxonomy_defaults/taxonomy_defaults.module on line 92.Comment #7
bradweikel commentedCould one of you test this process on the 6.x-1.1-beta release? I've completely removed the taxonomy_defaults_nodeapi function that the patch above alters, and I think it's pretty likely that this issue has gone away -- that function was poorly thought out and created lots of interaction problems with other modules.
Note that you MUST run the update script after installing the beta, and you'll need to enable "hidden" vocabularies on the vocabulary admin pages and then hide them on the taxonomy_defaults admin page. Cumbersome, I know -- but the cost of fixing a broken architecture.
Comment #8
bradweikel commented