Duplicate entries after 4.7 RC 3 update

hadishon - April 19, 2006 - 12:39
Project:Aggregator2
Version:HEAD
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:reviewed & tested by the community
Description

After updating drupal to 4.7 rc3, everytime I run cron (which refreshes the feeds) I get:
Duplicate entry '369-563' for key 1 query: INSERT INTO term_node (nid, tid) VALUES (563, 369) in httpdocs/includes/database.mysql.inc on line 120.

The values change depending on the feed.

Anyone else experiencing this? Or know how to fix it?

#1

hadishon - April 19, 2006 - 13:19
Status:active» fixed

Upgrading to drupal CVS head seems to fix the problem.

#2

hadishon - April 19, 2006 - 23:06
Title:Duplicate entries after 4.7 RC 3 update» Duplicate entries after 4.7 RC 3 update
Status:fixed» active

Well I thought it was fixed until aggregator2 syndicated more rss content and then I got these error messages again.

Is this a problem with aggregator2.module? I don't get these error messages any other time.

#3

zis - May 11, 2006 - 21:53
Status:active» fixed

I had the same problem It seems that for some reason, after the update, taxonomy vocabularies are not associated with feeds and items anymore.

To solve the problem, edit the feed and item vocabularies and associate them with the node types.

It worked for me.

#4

zis - May 14, 2006 - 23:43
Status:fixed» active

Sorry.
It was a false positive. Today after almost a week of it working fine. the errors started appearing again.

I'll look into it.

#5

zis - June 9, 2006 - 08:35
Priority:normal» critical

I think i got the issue cornered, but i need some help to fix it.

The error is apearing on every item update. That is an item that already exists and is updated. An error apears for every taxonomy term associated with this item.

I think its got to do with the hook_update implementation not checking for revisions or smthg. Here's the code:

/**
* Implementation of hook_update().
*/
function aggregator2_item_update($node) {
  db_query("UPDATE {aggregator2_item} SET link = '%s', author = '%s', fid = %d WHERE nid = %d", $node->link, $node->author, $node->fid, $node->nid);
}

in the drupal api, the implementation of hook update, is different:

function node_example_update($node) {
  // if this is a new node or we're adding a new revision,
  if ($node->revision) {
    node_example_insert($node);
  }
  else {
    db_query("UPDATE {node_example} SET color = '%s', quantity = %d WHERE vid = %d", $node->color, $node->quantity, $node->vid);
  }
}

here's the revision page of the handbook: http://drupal.org/node/30030

#6

Steve Dondley - July 27, 2006 - 18:50

I think this should fix it.

AttachmentSize
agg2.patch 682 bytes

#7

redraven - August 1, 2006 - 10:53
Status:active» needs review

Applied patch and it resolves this issue

+1 to commiting upon further review

#8

zis - August 9, 2006 - 12:18
Status:needs review» reviewed & tested by the community

Worked for me. +1 to commiting

#9

dalin - November 1, 2006 - 00:55

works for me
+1 for commiting

#10

peterdeitz - November 29, 2006 - 15:08

Hi all, I have installed the "patch" and run the upgrade.php script on my copy of Drupal. Despite these efforts, i'm still getting the "duplicate entry" error message. Do I have to empty drupal's chache of module information? Please advise. --Peter

#11

jarea - March 14, 2007 - 22:48

I am getting the same error, but running Leech in 5.1.

I added two values to the News Feeds taxonomy field and it generated one message for each RSS article node that I had online.

It appears that both terms were added to the category list, but only the second term was added to the individual node tags.

 
 

Drupal is a registered trademark of Dries Buytaert.