mirror of
https://github.com/zotero/zotero.git
synced 2026-09-20 00:12:49 +00:00
Closes #1860, Scaffold can't safely test collection creation
Zotero.Translate#translate(false) should no longer create collections. There was already a collectionDone event; it now gets the unprocessed collection object when false is passed to Zotero.Translate#translate.
This commit is contained in:
parent
5aa3189dd1
commit
69b53b1583
1 changed files with 9 additions and 3 deletions
|
|
@ -552,8 +552,14 @@ Zotero.Translate.Sandbox = {
|
|||
* @param {SandboxCollection} collection
|
||||
*/
|
||||
"_collectionDone":function(translate, collection) {
|
||||
var newCollection = translate._itemSaver.saveCollection(collection);
|
||||
translate._runHandler("collectionDone", newCollection);
|
||||
if(this._libraryID == false) {
|
||||
this.newCollections.push(collection);
|
||||
translate._runHandler("collectionDone", collection);
|
||||
} else {
|
||||
var newCollection = translate._itemSaver.saveCollection(collection);
|
||||
this.newCollections.push(newCollection);
|
||||
translate._runHandler("collectionDone", newCollection);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -1587,7 +1593,7 @@ Zotero.Translate.Import.prototype._prepareTranslation = function() {
|
|||
this._itemSaver = new Zotero.Translate.ItemSaver(this._libraryID,
|
||||
Zotero.Translate.ItemSaver[(this._saveAttachments ? "ATTACHMENT_MODE_FILE" : "ATTACHMENT_MODE_IGNORE")]);
|
||||
this.newItems = [];
|
||||
this.newCollections = this._itemSaver.newCollections;
|
||||
this.newCollections = [];
|
||||
}
|
||||
|
||||
Zotero.Translate.Import.prototype.__defineGetter__("progress",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue