I'm using Calais with FeedAPI. Calais is set to automatically tag nodes created by the feeds. Whenever cron runs, I get the following warning:

user warning: Duplicate entry '1152-0' for key 1 query: INSERT INTO term_node (nid, vid, tid) VALUES(94, 0, 1152) in /var/www/telecomvitals/sites/all/modules/opencalais/calais.module on line 282

This happens for multiple values.

Comments

febbraro’s picture

Funny you report this, I just had this error happen to me today w/ FeedAPI. Stupid halloween bugs.

I'll figure it out and get back with what is going on. Thanks for the report.

febbraro’s picture

Assigned: Unassigned » febbraro
febbraro’s picture

For some reason the $node->vid is not set on items getting updated. On an insert nod/vid are set, but on an update it appears only nid is set.

Wierd. This may be a feedapi bug.

febbraro’s picture

I commited a fix for this in CVS, but I want to see if it is a real bug in feedapi before I roll out a release, so it will wait a few days at least.

In the meantime this was the fix:

ndex: calais.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/opencalais/calais.module,v
retrieving revision 1.3.2.16.2.11
diff -r1.3.2.16.2.11 calais.module
108a109,114
>   // On feedapi runs, updates are missing vid so get it.
>   if(!isset($node->vid)) {
>     $node->vid = db_result(db_query("SELECT vid FROM {node} WHERE nid=%d", $node->nid));
>   }
> 
> 
pshibles’s picture

Fixed the issue for me. I'll keep an eye on both projects to see where the fix ends up making it in the long term. Thanks for such a quick response!

febbraro’s picture

Was fixed in FeedAPI as part of #328702: Feed Item updates don't contain a revision id.. Will close this once that is rolled into a production release of Feed API. It is in the dev release of Feed API from 2008-Nov-16 and on.

febbraro’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

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