From 65cae53535250cd939e10b30efd6975b16b62fac Mon Sep 17 00:00:00 2001 From: "Guillaume (gdi)" Date: Wed, 14 Jun 2023 12:45:51 +0000 Subject: [PATCH] [FIX] website: disable products carousel slide in edit mode We have a public widget that disables automatic slides on carousels when the user is in edit mode (see `registry.slider`). Unfortunately, since [this commit], the automatic slide of the carousel in the "Products" block was not disabled in edit mode. This was because a `widget_start_request` was made without specifying whether the user is in edit mode. When it's not specify, we consider that we are not in edit mode. As a result, the public widget no longer stopped the carousel because it considered that it was not in edit mode. This commit fixes this problem by correcting `widget_start_request`. Steps to reproduce the bug fixed by this commit: - Have an ecommerce - Edit a page - Drop the "Products" block => If you wait a few seconds, the carousel moves, even though it shouldn't as long as you're editing your site. [this commit]: https://github.com/odoo/odoo/commit/7af099ccf1e5892513c1b0827553fe93614f2f07 task-3356629 closes odoo/odoo#127185 X-original-commit: 4231aca9665829673e29a027469471743dab16c4 Signed-off-by: Quentin Smetz (qsm) Signed-off-by: Guillaume Dieleman (gdi) --- addons/website/static/src/snippets/s_dynamic_snippet/000.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/website/static/src/snippets/s_dynamic_snippet/000.js b/addons/website/static/src/snippets/s_dynamic_snippet/000.js index 625097ca0c1..9f7e340c57e 100644 --- a/addons/website/static/src/snippets/s_dynamic_snippet/000.js +++ b/addons/website/static/src/snippets/s_dynamic_snippet/000.js @@ -176,7 +176,11 @@ const DynamicSnippet = publicWidget.Widget.extend({ this.renderedContent = ''; } this._renderContent(); - this.trigger_up('widgets_start_request', {$target: this.$el.children(), options: {parent: this}}); + this.trigger_up('widgets_start_request', { + $target: this.$el.children(), + options: {parent: this}, + editableMode: this.editableMode, + }); }, /** * @private