commit 8da5e3bc099d0c7026187f8cb005a69a4d72d090 parent e9d69d80ee9a9f38171ccd443d749c4c781affda Author: Dan Stillman <dstillman@zotero.org> Date: Wed, 30 Mar 2011 00:38:14 +0000 Maybe fix "constraint failed" sync error in collection.js Diffstat:
| M | chrome/content/zotero/xpcom/data/collection.js | | | 7 | +++++++ |
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/chrome/content/zotero/xpcom/data/collection.js b/chrome/content/zotero/xpcom/data/collection.js @@ -534,6 +534,13 @@ Zotero.Collection.prototype.save = function () { } if (newids.length) { + // TEMP: Remove duplicates, which shouldn't be necessary + var len1 = newids.length; + newids = Zotero.Utilities.arrayUnique(newids); + if (len1 != newids.length) { + Zotero.debug("newids was not unique in Zotero.Collection.save()", 2); + } + var sql = "SELECT IFNULL(MAX(orderIndex)+1, 0) " + "FROM collectionItems WHERE collectionID=?" var orderStatement = Zotero.DB.getStatement(sql);