From 604571f98519b8d40b77ecc4805a8eb08fafe820 Mon Sep 17 00:00:00 2001 From: "Robin Lejeune (role)" Date: Fri, 20 Dec 2024 16:23:48 +0100 Subject: [PATCH] WebsiteForumSpam: renderToFragment template with multiple nodes --- .../static/src/interactions/website_forum_spam.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/website_forum/static/src/interactions/website_forum_spam.js b/addons/website_forum/static/src/interactions/website_forum_spam.js index 7fc895134c46d..b986a72c8a961 100644 --- a/addons/website_forum/static/src/interactions/website_forum_spam.js +++ b/addons/website_forum/static/src/interactions/website_forum_spam.js @@ -1,7 +1,7 @@ import { browser } from "@web/core/browser/browser"; import { registry } from "@web/core/registry"; import { KeepLast } from "@web/core/utils/concurrency"; -import { renderToElement } from "@web/core/utils/render"; +import { renderToFragment } from "@web/core/utils/render"; import { Interaction } from "@web/public/interaction"; import { cloneContentEls } from "@website/js/utils"; @@ -51,7 +51,8 @@ class WebsiteForumSpam extends Interaction { const childEl = cloneContentEls(post.content).firstElementChild; post.content = childEl.textContent.substring(0, 250); }); - this.insert(renderToElement("website_forum.spam_search_name", { posts }), postSpamEl); + // No need for cleanup, it's already done above. + postSpamEl.append(renderToFragment("website_forum.spam_search_name", { posts })); } async onMarkSpamClick() {