From 89e08b08bfac76c2441fc3e4ae0482cbc11c422d Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 30 Jun 2023 13:09:31 +0200 Subject: [PATCH] Fix rich text loss of data #1074 --- www/common/sframe-app-framework.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/www/common/sframe-app-framework.js b/www/common/sframe-app-framework.js index 849e38fc9..c0c4e9106 100644 --- a/www/common/sframe-app-framework.js +++ b/www/common/sframe-app-framework.js @@ -108,11 +108,13 @@ define([ var contentGetter = function () { return UNINITIALIZED; }; var cursorGetter; var normalize0 = function (x) { return x; }; + var EMPTY = {}; var normalize = function (x) { x = normalize0(x); if (Array.isArray(x)) { var outa = Array.prototype.slice.call(x); + EMPTY = []; if (typeof(outa[outa.length-1].metadata) === 'object') { outa.pop(); } return outa; } else if (typeof(x) === 'object') { @@ -239,7 +241,7 @@ define([ var sNew = JSONSortify(newContent); if (sNew === JSONSortify(oldContent)) { return; } try { - if (sNew !== JSONSortify(normalize(oldContent || {}))) { + if (integration && sNew !== JSONSortify(normalize(oldContent || EMPTY))) { evIntegrationSave.fire(); } evContentUpdate.fire(newContent, waitFor);