diff --git a/www/common/outer/messenger.js b/www/common/outer/messenger.js index 981d9f8de..85400adc0 100644 --- a/www/common/outer/messenger.js +++ b/www/common/outer/messenger.js @@ -617,11 +617,11 @@ define([ return void cb({error: 'NO_SUCH_CHANNEL'}); } - var proxy = ctx.store.proxy; + var proxy = ctx.store.proxy || {}; var msg = [Types.message, proxy.curvePublic, +new Date(), payload]; if (!channel.isFriendChat) { var name = proxy[Constants.displayNameKey] || - Messages.anonymous + '#' + proxy.uid.slice(0,5); + Messages.anonymous + '#' + (proxy.uid || ctx.store.noDriveUid).slice(0,5); msg.push(name); } var msgStr = JSON.stringify(msg); diff --git a/www/form/export.js b/www/form/export.js index ff4d48dfc..94a4bd98f 100644 --- a/www/form/export.js +++ b/www/form/export.js @@ -13,7 +13,7 @@ define([ value += '"' + vv + '"'; return value; }; - Export.results = function (content, answers, TYPES, isArray) { + Export.results = function (content, answers, TYPES, order, isArray) { if (!content || !content.form) { return; } var csv = ""; var array = []; @@ -21,7 +21,7 @@ define([ var questions = [Messages.form_poll_time, Messages.share_formView]; - content.order.forEach(function (key) { + order.forEach(function (key) { var obj = form[key]; if (!obj) { return; } var type = obj.type; @@ -47,7 +47,7 @@ define([ var line = []; line.push(time); line.push(user.name || Messages.anonymous); - content.order.forEach(function (key) { + order.forEach(function (key) { var type = form[key].type; if (!TYPES[type]) { return; } // Ignore static types if (TYPES[type].exportCSV) { diff --git a/www/form/inner.js b/www/form/inner.js index 0920bfa5f..093f572b9 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -2628,7 +2628,7 @@ define([ var $results = $(results).appendTo($container); $(exportButton).click(function () { - var csv = Exporter.results(content, answers, TYPES); + var csv = Exporter.results(content, answers, TYPES, getFullOrder(content)); if (!csv) { return void UI.warn(Messages.error); } var suggestion = APP.framework._.title.suggestTitle('cryptpad-document'); var title = Util.fixFileName(suggestion) + '.csv'; @@ -2645,7 +2645,7 @@ define([ ]); $(export2Button).appendTo($controls); $(export2Button).click(function () { - var arr = Exporter.results(content, answers, TYPES, true); + var arr = Exporter.results(content, answers, TYPES, getFullOrder(content), true); if (!arr) { return void UI.warn(Messages.error); } var sframeChan = framework._.sfCommon.getSframeChannel(); var title = framework._.title.title || framework._.title.defaultTitle; @@ -2662,7 +2662,8 @@ define([ $controls.hide().append(switchMode); var show = function (answers, header) { - var elements = content.order.map(function (uid) { + var order = getFullOrder(content); + var elements = order.map(function (uid) { var block = form[uid]; var type = block.type; var model = TYPES[type];