From 6fc6dbe4e504ab00150e00d5575f92352b39ff63 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sat, 19 Sep 2009 23:43:51 +0000 Subject: [PATCH] Fix missing item exception on documents being upgraded from 1.0 (see http://forums.zotero.org/discussion/8859/?Focus=41140#Comment_41140) --- chrome/content/zotero/xpcom/integration.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index 8c15da9f18..db08553f98 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -180,7 +180,7 @@ Zotero.Integration = new function() { } } - if(!message && typeof(e) == "object" && e.message) message = "\n"+e.message; + if(!message && typeof(e) == "object" && e.message) message = "\n\n"+e.message; integration._doc.displayAlert(Zotero.getString("integration.error.generic")+message, Components.interfaces.zoteroIntegrationDocument.DIALOG_ICON_STOP, @@ -1048,10 +1048,10 @@ Zotero.Integration.Session.prototype.completeCitation = function(object) { var reselectKeys = citationItem.uri; var reselectKeyType = RESELECT_KEY_URI; } else if(citationItem.key) { - var reselectKeys = citationItem.key; + var reselectKeys = [citationItem.key]; var reselectKeyType = RESELECT_KEY_ITEM_KEY; } else { - var reselectKeys = citationItem.itemID; + var reselectKeys = [citationItem.itemID]; var reselectKeyType = RESELECT_KEY_ITEM_ID; } @@ -1059,6 +1059,7 @@ Zotero.Integration.Session.prototype.completeCitation = function(object) { for each(var reselectKey in reselectKeys) { if(this.reselectedItems[reselectKey]) { zoteroItem = Zotero.Items.get(this.reselectedItems[reselectKey]); + citationItem.itemID = zoteroItem.id; returnNeedUpdate = true; break; }