diff --git a/chrome/content/zotero/xpcom/connector/server_connector.js b/chrome/content/zotero/xpcom/connector/server_connector.js index dd891125ed..c80293b25a 100644 --- a/chrome/content/zotero/xpcom/connector/server_connector.js +++ b/chrome/content/zotero/xpcom/connector/server_connector.js @@ -742,9 +742,10 @@ Zotero.Server.Connector.SaveItems.prototype = { session, targetID, requestData, - function (topLevelItems) { + function (jsonItems, items) { + session.addItems(items); // Only return the properties the connector needs - topLevelItems = topLevelItems.map((item) => { + jsonItems = jsonItems.map((item) => { let o = { id: item.id, title: item.title, @@ -764,7 +765,7 @@ Zotero.Server.Connector.SaveItems.prototype = { }; return o; }); - resolve([201, "application/json", JSON.stringify({items: topLevelItems})]); + resolve([201, "application/json", JSON.stringify({items: jsonItems})]); } ) // Add items to session once all attachments have been saved diff --git a/chrome/content/zotero/xpcom/translation/translate_item.js b/chrome/content/zotero/xpcom/translation/translate_item.js index c9fe751858..afafa0380f 100644 --- a/chrome/content/zotero/xpcom/translation/translate_item.js +++ b/chrome/content/zotero/xpcom/translation/translate_item.js @@ -179,7 +179,7 @@ Zotero.Translate.ItemSaver.prototype = { }.bind(this)); if (itemsDoneCallback) { - itemsDoneCallback(items.map(item => jsonByItem.get(item))); + itemsDoneCallback(items.map(item => jsonByItem.get(item)), items); } // Save standalone attachments