diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index 4db52ca9d..6eb682547 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -1552,7 +1552,7 @@ Zotero.Translate.Import.prototype.setString = function(string) { Zotero.Translate.Import.prototype.complete = function(returnValue, error) { if(this._io) { this._progress = null; - this._io.close(); + this._io.close(false); } // call super @@ -1732,7 +1732,7 @@ Zotero.Translate.Export.prototype.setDisplayOptions = function(displayOptions) { Zotero.Translate.Export.prototype.complete = function(returnValue, error) { if(this._io) { this._progress = null; - this._io.close(); + this._io.close(true); if(this._io instanceof Zotero.Translate.IO.String) { this.string = this._io.string; } @@ -2068,7 +2068,13 @@ Zotero.Translate.IO.String.prototype = { } }, - "close":function() {} + "close":function(serialize) { + // if we are writing in RDF data mode and no string is set, serialize current RDF to the + // string + if(serialize && Zotero.Translate.IO.rdfDataModes.indexOf(this._mode) !== -1 && this.string === "") { + this.string = this.RDF.serialize(); + } + } } /****** RDF DATA MODE ******/