diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index 053a87944..33fb57f18 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -227,8 +227,28 @@ Zotero.Translate.Sandbox = { if(Zotero.isFx && !Zotero.isBookmarklet && (translate instanceof Zotero.Translate.Web || translate instanceof Zotero.Translate.Search)) { - // necessary to get around object wrappers in Firefox + // Necessary to get around object wrappers in Firefox + var attachments = item.attachments; + delete item.attachments; + item = translate._sandboxManager.sandbox.Zotero._transferItem(JSON.stringify(item)); + item.attachments = []; + + // Manually copy attachments in case there are documents, which + // can't be serialized and don't need to be + if(attachments) { + for(var i=0; i