summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/editor
diff options
context:
space:
mode:
authorBenjamin Vray <bvr@odoo.com>2020-10-27 13:55:37 +0000
committerBenjamin Vray <bvr@odoo.com>2020-11-06 08:37:52 +0000
commit10ac750aaecf502500dc08966f4642a8604a685b (patch)
treeaeb864e59b40fc36e2ccb30b27d5a6999638033e /addons/web_editor/static/src/js/editor
parent9db7b9bdbd86405fdfe2c0efccebea780b7ffb63 (diff)
[FIX] web_editor: allow single quotes in getShapeData
Before this commit, the value of data-oe-shape-data required double quotes to be properly parsed in JSON in the getShapeData method. After this commit, we also allow single quotes to prevent issue if someone doesn't use double quotes in the the value of data-oe-shape-data. Which was precisely the case in one of the themes and this is why this commit is a fix. task-2327741 closes odoo/odoo#60835 Related: odoo/design-themes#421 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src/js/editor')
-rw-r--r--addons/web_editor/static/src/js/editor/snippets.options.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js
index 552652f23b8..5050a622bd6 100644
--- a/addons/web_editor/static/src/js/editor/snippets.options.js
+++ b/addons/web_editor/static/src/js/editor/snippets.options.js
@@ -4023,7 +4023,7 @@ registry.BackgroundShape = SnippetOptionWidget.extend({
flip: [],
};
const json = target.dataset.oeShapeData;
- return json ? Object.assign(defaultData, JSON.parse(json)) : defaultData;
+ return json ? Object.assign(defaultData, JSON.parse(json.replace(/'/g, '"'))) : defaultData;
},
/**
* Returns the default colors for the currently selected shape.