Fix mangled large reports
https://forums.zotero.org/discussion/64022/5-0-beta-generate-report-is-often-garbled Records are being truncated, though I'm not sure why. But just read the input stream into a string for now.
This commit is contained in:
parent
9b247ebba7
commit
5236d01791
1 changed files with 15 additions and 1 deletions
|
@ -444,12 +444,26 @@ function ZoteroProtocolHandler() {
|
||||||
|
|
||||||
default:
|
default:
|
||||||
this.contentType = 'text/html';
|
this.contentType = 'text/html';
|
||||||
return Zotero.Utilities.Internal.getAsyncInputStream(
|
|
||||||
|
// DEBUG: Results in mangled reports
|
||||||
|
//
|
||||||
|
// https://forums.zotero.org/discussion/64022/5-0-beta-generate-report-is-often-garbled
|
||||||
|
/*return Zotero.Utilities.Internal.getAsyncInputStream(
|
||||||
|
Zotero.Report.HTML.listGenerator(items, combineChildItems),
|
||||||
|
function () {
|
||||||
|
return '<span style="color: red; font-weight: bold">Error generating report</span>';
|
||||||
|
}
|
||||||
|
);*/
|
||||||
|
|
||||||
|
Components.utils.import("resource://gre/modules/NetUtil.jsm");
|
||||||
|
var is = Zotero.Utilities.Internal.getAsyncInputStream(
|
||||||
Zotero.Report.HTML.listGenerator(items, combineChildItems),
|
Zotero.Report.HTML.listGenerator(items, combineChildItems),
|
||||||
function () {
|
function () {
|
||||||
return '<span style="color: red; font-weight: bold">Error generating report</span>';
|
return '<span style="color: red; font-weight: bold">Error generating report</span>';
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
var str = NetUtil.readInputStreamToString(is, is.available(), {});
|
||||||
|
return Zotero.Promise.resolve(str);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue