Merge branch 'soon' into staging

pull/1/head
ansuz 4 years ago
commit 97646fdb89

@ -3,7 +3,10 @@
* Sheet export * Sheet export
* most exports broken by Chrome 92, mostly fixed * most exports broken by Chrome 92, mostly fixed
* we discovered that CSV export was not working in any major browser, though it's unclear why. We've disabled CSV export in the meantime * we discovered that CSV export was not working in any major browser, though it's unclear why. We've disabled CSV export in the meantime
* some new browser-specific checkup tests to make it easier to detect future regressions in the APIs needed for sheet export * updated translation to stop referring to Microsoft since we support OpenDocument formats
* some new browser-specific checkup tests to make it easier to detect future regressions in the APIs
* drive bug fixes
* guard against a few possible type errors
# 4.9.0 # 4.9.0

@ -906,7 +906,7 @@ define([
h('table', [ h('table', [
row(["Failed test number", obj.test + 1]), row(["Failed test number", obj.test + 1]),
row(["Returned value", h('pre', code(printableValue))]), row(["Returned value", h('pre', code(printableValue))]),
]), ])
), ),
]); ]);
}; };

@ -316,13 +316,24 @@ define([
// Get data from AllFiles (Cryptpad_RECENTPADS) // Get data from AllFiles (Cryptpad_RECENTPADS)
var getFileData = exp.getFileData = function (file, editable) { var getFileData = exp.getFileData = function (file, editable) {
if (!file) { return; } if (!file) { return; }
var link = (files[STATIC_DATA] || {})[file]; var link;
try {
link = (files[STATIC_DATA] || {})[file];
} catch (err) {
console.error(err);
}
if (link) { if (link) {
var _link = editable ? link : Util.clone(link); var _link = editable ? link : Util.clone(link);
if (!editable) { _link.static = true; } if (!editable) { _link.static = true; }
return _link; return _link;
} }
var data = files[FILES_DATA][file] || {}; var data;
try {
data = files[FILES_DATA][file] || {};
} catch (err) {
console.error(err);
data = {};
}
if (!editable) { if (!editable) {
data = JSON.parse(JSON.stringify(data)); data = JSON.parse(JSON.stringify(data));
if (data.href && data.href.indexOf('#') === -1) { if (data.href && data.href.indexOf('#') === -1) {
@ -356,8 +367,13 @@ define([
return '??'; return '??';
} }
var data = getFileData(file); var data = getFileData(file);
if (!data) {
error("unable to retrieve data about the requested file: ", file, data);
return;
}
// handle links
if (data.static) { return data.name; } if (data.static) { return data.name; }
if (!file || !data || !(data.href || data.roHref)) { if (!file || !(data.href || data.roHref)) {
error("getTitle called with a non-existing file id: ", file, data); error("getTitle called with a non-existing file id: ", file, data);
return; return;
} }

Loading…
Cancel
Save