From 38506df2a158b10d1e284da2c723b3c57b38ca32 Mon Sep 17 00:00:00 2001 From: "Robin Lejeune (role)" Date: Fri, 26 Jan 2024 10:29:39 +0100 Subject: [PATCH] [FIX] web_editor: fix CTA button upgrade After upgrading (specifically following this [upgrade PR]), when editing an element, the editor may be tricked into considering that the page isn't correct even though it is. It causes the "discard" dialog to open. Steps to reproduce after the [upgrade PR]: - Remove the CTA in 16.0 with the bin icon (on the button itself, or from the edit panel, next to the "Block" section). - Upgrade to 17.0. - The button is back. Edit the header and click to hide it. => a dialog opens "Are you sure you want to discard your changes?". - Click either "yes" or "cancel". => either way, nothing is discarded nor cancelled. [upgrade PR]: https://github.com/odoo/upgrade/pull/5500 Related to opw-3644220 closes odoo/odoo#151291 Signed-off-by: Guillaume Dieleman (gdi) --- addons/web_editor/static/src/js/wysiwyg/wysiwyg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index a7f022afab3..f9107514cc2 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -2643,7 +2643,7 @@ export class Wysiwyg extends Component { .removeClass(id) .popover({ trigger: 'hover', - content: response.message.data.message || '', + content: response.message.data?.message || '', placement: 'auto', }) .popover('show');