From e157d8bc576dfd5f0d0862c8b2bf18e6df8a4fa9 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 7 Feb 2013 17:36:37 -0500 Subject: [PATCH] Fix sync error downloading new item with related item --- chrome/content/zotero/xpcom/data/item.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index e8cfa6579..57bb16c6b 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -1546,26 +1546,10 @@ Zotero.Item.prototype.save = function() { var newids = []; var currentIDs = this._getRelatedItems(true); - for each(var id in this._previousData.related) { - if (currentIDs.indexOf(id) == -1) { - removed.push(id); - } - } for each(var id in currentIDs) { - if (this._previousData.related.indexOf(id) != -1) { - continue; - } newids.push(id); } - if (removed.length) { - var sql = "DELETE FROM itemSeeAlso WHERE itemID=? " - + "AND linkedItemID IN (" - + removed.map(function () '?').join() - + ")"; - Zotero.DB.query(sql, [itemID].concat(removed)); - } - if (newids.length) { var sql = "INSERT INTO itemSeeAlso (itemID, linkedItemID) VALUES (?,?)"; var insertStatement = Zotero.DB.getStatement(sql);