mirror of
https://github.com/zotero/zotero.git
synced 2026-09-20 00:12:49 +00:00
Fix id changing with items with highlights or annotations
This commit is contained in:
parent
a4d049fe46
commit
fe3ff13571
1 changed files with 2 additions and 2 deletions
|
|
@ -1017,9 +1017,7 @@ Zotero.Item.prototype.save = function() {
|
|||
Zotero.DB.query("INSERT INTO items VALUES (?, ?, ?, ?, ?)",
|
||||
[this.id, row.itemTypeID, row.dateAdded, row.dateModified, 'TEMPKEY']);
|
||||
|
||||
Zotero.DB.query("UPDATE annotations SET itemID=? WHERE itemID=?", params);
|
||||
Zotero.DB.query("UPDATE collectionItems SET itemID=? WHERE itemID=?", params);
|
||||
Zotero.DB.query("UPDATE highlights SET itemID=? WHERE itemID=?", params);
|
||||
Zotero.DB.query("UPDATE itemCreators SET itemID=? WHERE itemID=?", params);
|
||||
Zotero.DB.query("UPDATE itemAttachments SET itemID=? WHERE itemID=?", params);
|
||||
Zotero.DB.query("UPDATE itemAttachments SET sourceItemID=? WHERE sourceItemID=?", params);
|
||||
|
|
@ -1031,6 +1029,8 @@ Zotero.Item.prototype.save = function() {
|
|||
Zotero.DB.query("UPDATE itemTags SET itemID=? WHERE itemID=?", params);
|
||||
Zotero.DB.query("UPDATE fulltextItemWords SET itemID=? WHERE itemID=?", params);
|
||||
Zotero.DB.query("UPDATE fulltextItems SET itemID=? WHERE itemID=?", params);
|
||||
Zotero.DB.query("UPDATE annotations SET itemID=? WHERE itemID=?", params);
|
||||
Zotero.DB.query("UPDATE highlights SET itemID=? WHERE itemID=?", params);
|
||||
|
||||
Zotero.DB.query("DELETE FROM items WHERE itemID=?", oldID);
|
||||
Zotero.DB.query("UPDATE items SET key=? WHERE itemID=?", [row.key, this.id]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue