diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index d6b34e52e..5403640a4 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -247,35 +247,18 @@ Zotero.Translate.Sandbox = { translation.setHandler(arg1, function(obj, item) { try { + item = item.wrappedJSObject ? item.wrappedJSObject : item; if(arg1 == "itemDone") { + var sbZotero = translate._sandboxManager.sandbox.Zotero; + if(sbZotero.wrappedJSObject) sbZotero = sbZotero.wrappedJSObject; if(Zotero.isFx && !Zotero.isBookmarklet && (translate instanceof Zotero.Translate.Web || translate instanceof Zotero.Translate.Search)) { // Necessary to get around object wrappers in Firefox - var attachments = item.attachments; - - item.attachments = []; - item = translate._sandboxManager.sandbox.Zotero._transferItem(JSON.stringify(item)); - - // 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