[FIX] web_editor: reload iframe when header change on controller pages
When a user browses a website, he can visit two types of pages: - Static page: the page is a website.page record. - Dynamic / controller page: the page isn't a website.page (e.g. /shop). Some options are only available on static pages, like the option to make the header over the content. Since [this other commit], when a user change the header template, the editor activate/deactivate an extra options in addition to the header template change. The problem is that this extra option may be available only on static pages, and the option to change the header template is available on all pages. Before this commit, if the extra option is not available, we stop the process, the page was not reloaded and the user didn't see the new header template. Now, we just ignore the extra option without stopping the process, so the page is reloaded and the user see the new header. Steps to reproduce the issue fixed by this commit: - Go to /shop - Edit - Change the header template => The header template is not changed. [this other commit]: https://github.com/odoo/odoo/commit/e7dcfc19298948b76caa4c214724c93854cf5f4c task-3572277 closes odoo/odoo#139896 Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
This commit is contained in:
@@ -4395,11 +4395,10 @@ const SnippetOptionWidget = Widget.extend({
|
||||
}
|
||||
|
||||
// Check linked widgets: force their value and simulate a notification
|
||||
// It is possible that we don't have the widget, we continue because a
|
||||
// reload might be needed. For example, change template header without
|
||||
// being on a website.page (e.g: /shop).
|
||||
const linkedWidgets = this._requestUserValueWidgets(...ev.data.triggerWidgetsNames);
|
||||
if (linkedWidgets.length !== ev.data.triggerWidgetsNames.length) {
|
||||
console.warn('Missing widget to trigger');
|
||||
return;
|
||||
}
|
||||
let i = 0;
|
||||
const triggerWidgetsValues = ev.data.triggerWidgetsValues;
|
||||
for (const linkedWidget of linkedWidgets) {
|
||||
|
||||
Reference in New Issue
Block a user