fix item saving in group collections

This commit is contained in:
Simon Kornblith 2011-02-07 05:20:08 +00:00
parent 9a82adb3a5
commit 7046f894ff

View File

@ -665,7 +665,9 @@ Zotero.Translate.Base.prototype = {
if(!this._displayOptions) this._displayOptions = this.translator[0].displayOptions; if(!this._displayOptions) this._displayOptions = this.translator[0].displayOptions;
// prepare translation // prepare translation
this._prepareTranslation(libraryID, typeof saveAttachments === "undefined" ? true : saveAttachments); this._libraryID = libraryID;
this._saveAttachments = typeof saveAttachments === "undefined" ? true : saveAttachments;
this._prepareTranslation();
Zotero.debug("Translate: Beginning translation with "+this.translator[0].label); Zotero.debug("Translate: Beginning translation with "+this.translator[0].label);
@ -1007,9 +1009,9 @@ Zotero.Translate.Web.prototype._getParameters = function() { return [this.docume
/** /**
* Prepare translation * Prepare translation
*/ */
Zotero.Translate.Web.prototype._prepareTranslation = function(libraryID, saveAttachments) { Zotero.Translate.Web.prototype._prepareTranslation = function() {
this._itemSaver = new Zotero.Translate.ItemSaver(libraryID, this._itemSaver = new Zotero.Translate.ItemSaver(this._libraryID,
Zotero.Translate.ItemSaver[(saveAttachments ? "ATTACHMENT_MODE_DOWNLOAD" : "ATTACHMENT_MODE_IGNORE")], 1); Zotero.Translate.ItemSaver[(this._saveAttachments ? "ATTACHMENT_MODE_DOWNLOAD" : "ATTACHMENT_MODE_IGNORE")], 1);
this.newItems = this._itemSaver.newItems; this.newItems = this._itemSaver.newItems;
} }
@ -1152,10 +1154,10 @@ Zotero.Translate.Import.prototype._loadTranslator = function(translator) {
/** /**
* Prepare translation * Prepare translation
*/ */
Zotero.Translate.Import.prototype._prepareTranslation = function(libraryID, saveAttachments) { Zotero.Translate.Import.prototype._prepareTranslation = function() {
this._progress = undefined; this._progress = undefined;
this._itemSaver = new Zotero.Translate.ItemSaver(libraryID, this._itemSaver = new Zotero.Translate.ItemSaver(this._libraryID,
Zotero.Translate.ItemSaver[(saveAttachments ? "ATTACHMENT_MODE_FILE" : "ATTACHMENT_MODE_IGNORE")]); Zotero.Translate.ItemSaver[(this._saveAttachments ? "ATTACHMENT_MODE_FILE" : "ATTACHMENT_MODE_IGNORE")]);
this.newItems = this._itemSaver.newItems; this.newItems = this._itemSaver.newItems;
this.newCollections = this._itemSaver.newCollections; this.newCollections = this._itemSaver.newCollections;
} }
@ -1237,7 +1239,7 @@ Zotero.Translate.Export.prototype._detect = function() {
/** /**
* Does the actual export, after code has been loaded and parsed * Does the actual export, after code has been loaded and parsed
*/ */
Zotero.Translate.Export.prototype._prepareTranslation = function(libraryID, saveAttachments) { Zotero.Translate.Export.prototype._prepareTranslation = function() {
this._progress = undefined; this._progress = undefined;
// initialize ItemGetter // initialize ItemGetter
@ -1354,7 +1356,7 @@ Zotero.Translate.Search.prototype.complete = function(returnValue, error) {
+this._generateErrorString(error), 3); +this._generateErrorString(error), 3);
if(this.translator.length > 1) { if(this.translator.length > 1) {
this.translator.shift(); this.translator.shift();
this.translate(this._libraryID, this.saveAttachments); this.translate(this._libraryID, this._saveAttachments);
return; return;
} }
} }