fix for any other translators that create enormous arrays instead of objects
This commit is contained in:
parent
f22ab3080c
commit
3ea54df059
1 changed files with 10 additions and 0 deletions
|
@ -643,6 +643,16 @@ Zotero.Connector.Translate.Save.prototype = {
|
||||||
var instanceID = Zotero.randomString();
|
var instanceID = Zotero.randomString();
|
||||||
Zotero.Connector.Translate._waitingForSelection[instanceID] = this;
|
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
|
// Send "Multiple Choices" HTTP response
|
||||||
this.sendResponse(300, "application/json", JSON.stringify({"items":itemList, "instanceID":instanceID, "uri":this._parsedPostData.uri}));
|
this.sendResponse(300, "application/json", JSON.stringify({"items":itemList, "instanceID":instanceID, "uri":this._parsedPostData.uri}));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue