We get this error from MySQL:
Duplicate entry '9756-1282543' for key 'PRIMARY' [warning]
query: INSERT INTO org_drupal_term_node (nid, vid, tid) VALUES (66494, 1282543, 9756) database.mysqli.inc

I have tracked it down to a problem that exists when opencalais is higher in the module list order than taxonomy. This is what happens:
1. calais_nodeapi -> calais_process_node -> calais_apply_to_node -> calais_assign_taxonomyterm_to_node -> inserts to the database.
2. taxonomy also inserts to the database without checking that it has been done since it should be in charge of that.

It seems like a good solution would be to only add the term to the node object during the "presave" step of nodeapi and then allow taxonomy to handle the database operations. That would work regardless of which module runs the "update" step first.

Comments

ElusiveMind’s picture

Issue summary: View changes

This was fixed in the current 6.x-3.x branch but was never updated.

Download here:

https://github.com/ElusiveMind/opencalais/tree/6.x-3.x

ElusiveMind’s picture

Status: Active » Needs review