From 1d0b427b67eae8be6b06d477911ecb76be9a18f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20De=20Caluw=C3=A9?= Date: Thu, 10 Feb 2022 13:42:54 +0000 Subject: [PATCH] [FIX] website_forum: prevent crash when trying to create a forum An extra xml dependency was inadvertently added in the ForumCreateDialog in commit [1] by inheriting the web_editor.toolbar template, since the file where it is inherited is an xml dependency of the ForumCreateDialog widget. While the dependency is correctly loaded in the public widget it is not in the creation dialog widget, resulting in a crash. Furthermore, the ForumCreateDialog widget does not actually need this template and neither does the public widget need the other templates already present in the same file at the time of the mentioned commit. Moving the extended toolbar template to the website_forum_share_templates file, allows for removing of the unnecessary dependencies. This includes the missing dependency of the ForumCreateDialog, preventing the crash. [1]: 740168ce8d27da3d6a7156d2d79655a898394923 task-2749467 X-original-commit: 4ad966de67278c2081c1896c354b9b1782cf6dc1 Part-of: odoo/odoo#85998 --- addons/website_forum/static/src/js/website_forum.js | 1 - .../src/xml/website_forum_share_templates.xml | 13 +++++++++++++ .../static/src/xml/website_forum_templates.xml | 13 ------------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/addons/website_forum/static/src/js/website_forum.js b/addons/website_forum/static/src/js/website_forum.js index 99efe81406a..a24f67a517a 100644 --- a/addons/website_forum/static/src/js/website_forum.js +++ b/addons/website_forum/static/src/js/website_forum.js @@ -16,7 +16,6 @@ publicWidget.registry.websiteForum = publicWidget.Widget.extend({ selector: '.website_forum', xmlDependencies: [ '/web_editor/static/src/xml/editor.xml', - '/website_forum/static/src/xml/website_forum_templates.xml', '/website_forum/static/src/xml/website_forum_share_templates.xml', ], events: { diff --git a/addons/website_forum/static/src/xml/website_forum_share_templates.xml b/addons/website_forum/static/src/xml/website_forum_share_templates.xml index e1ef8d75194..b9c1f50b685 100644 --- a/addons/website_forum/static/src/xml/website_forum_share_templates.xml +++ b/addons/website_forum/static/src/xml/website_forum_share_templates.xml @@ -72,4 +72,17 @@ + + + + + + + +
+
+
+
+ + diff --git a/addons/website_forum/static/src/xml/website_forum_templates.xml b/addons/website_forum/static/src/xml/website_forum_templates.xml index ce2e638c29a..aedc6223079 100644 --- a/addons/website_forum/static/src/xml/website_forum_templates.xml +++ b/addons/website_forum/static/src/xml/website_forum_templates.xml @@ -50,17 +50,4 @@
- - - - - - - -
-
-
-
- -