From 7950d3a7e217ce8bceb80dcf7c4e5fac28cd2695 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Thu, 19 Jun 2014 20:07:31 -0400 Subject: [PATCH] Attempt to fix #502, translation broken on Firefox 32 --- .../zotero/xpcom/translation/translate.js | 65 ++++++++----------- .../xpcom/translation/translate_firefox.js | 1 + 2 files changed, 28 insertions(+), 38 deletions(-) diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index d6b34e52ef..5403640a47 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