Maybe fix "constraint failed" sync error in collection.js
This commit is contained in:
parent
e9d69d80ee
commit
8da5e3bc09
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue