www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 3ea54df059d5974d56ebde65c615875b0f0d4028
parent f22ab3080c7576e1bdb27252b8cbd46c3b6b474c
Author: Simon Kornblith <simon@simonster.com>
Date:   Thu, 10 Feb 2011 00:35:48 +0000

fix for any other translators that create enormous arrays instead of objects


Diffstat:
Mchrome/content/zotero/xpcom/connector.js | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/chrome/content/zotero/xpcom/connector.js b/chrome/content/zotero/xpcom/connector.js @@ -643,6 +643,16 @@ Zotero.Connector.Translate.Save.prototype = { var instanceID = Zotero.randomString(); Zotero.Connector.Translate._waitingForSelection[instanceID] = this; + // Fix for translators that don't create item lists as objects + if(itemList.push && typeof itemList.push === "function") { + var newItemList = {}; + for(var item in itemList) { + Zotero.debug(item); + newItemList[item] = itemList[item]; + } + itemList = newItemList; + } + // Send "Multiple Choices" HTTP response this.sendResponse(300, "application/json", JSON.stringify({"items":itemList, "instanceID":instanceID, "uri":this._parsedPostData.uri}));