From 458c26d30769820b43474ec4dc248d3728c816c7 Mon Sep 17 00:00:00 2001 From: "Arthur Detroux (ard)" Date: Fri, 17 Nov 2023 13:17:00 +0100 Subject: [PATCH] [FIX] website: fix traceback when saving anchor with unchanged name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since commit [1], anchor dialog is now in OWL. During adaptation, a line of code was forgotten which lead to a traceback when an anchor is saved with an unchanged name. Steps to reproduce: - Drop a Text-Image snippet and set an anchor on it. - On the anchor notification, click on "Edit" - In the dialog, do not modify the anchor name (or change it but then set the original one again) - Click on "Save & Copy" => Traceback [1]: https://github.com/odoo/odoo/commit/57ed8bc0bf9d1ae2b7542d677a4d7e8fd1899ea2 task-3576975 closes odoo/odoo#141936 Signed-off-by: Soukéina Bojabza (sobo) --- addons/website/static/src/js/editor/snippets.options.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index 44ef1b631b3..521365d3ba1 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -2749,8 +2749,7 @@ options.registry.anchor = options.Class.extend({ if (this.$target[0].id === anchorName) { // If the chosen anchor name is already the one used by the // element, close the dialog and do nothing else - this.close(); - return; + return true; } const alreadyExists = !!this.ownerDocument.getElementById(anchorName);