commit bfa8786fb4f58df54a48acceaff73561d298249c parent 3a81751d4226695d8497702dc0a128f7d003eb95 Author: Simon Kornblith <simon@simonster.com> Date: Sat, 18 Jun 2011 15:37:07 +0000 Don't try to send documents via connectors Diffstat:
| M | chrome/content/zotero/xpcom/connector/translate_item.js | | | 9 | +++++++++ |
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/chrome/content/zotero/xpcom/connector/translate_item.js b/chrome/content/zotero/xpcom/connector/translate_item.js @@ -33,6 +33,15 @@ Zotero.Translate.ItemSaver.ATTACHMENT_MODE_FILE = 2; Zotero.Translate.ItemSaver.prototype = { "saveItem":function(item) { + // don't save documents as documents, since we can't pass them around + for(var i in item.attachments) { + if(item.attachments[i].document) { + item.attachments[i].url = item.attachments[i].document.location.href; + delete item.attachments[i].document; + } + } + + // save items this.newItems.push(item); Zotero.Connector.callMethod("saveItems", {"items":[item]}, function(success) {}); }