From ed732ab4ca62841242515d7dbc1c30cd1d7ea3de Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Mon, 5 Feb 2024 13:07:26 +0100 Subject: [PATCH] [FIX] website: fix removing a local google font Steps to reproduce the bug: - Enter edit mode. - Click on the "Theme" tab in the options panel. - Click on "Add a Google Font" in the "Font Family" select. - Paste the address of a font page in the input. - Disable the "Serve font from Google servers" toggle. - Save the dialog. - After the reload, click on the "Theme" tab. - Open the "Font Family" select. - Click on the "Remove" button for the recently added font. - Confirm your choice to close the dialog. - After the reload, click on the "Theme" tab. - Open the "Font Family" select. - Bug: the font has not been removed. This bug appeared with commit [1]. With the transition to the Owl render engine, the 'true' value passed as a parameter in the 'delete_google_font_btn' template, defining whether a font is local, wasn't being set as the attribute value in the template. In this Owl context, 'true' indicates the attribute's presence, not its value. To address this, we replaced the boolean 'true' with the string '"true"' to ensure the parameter value is correctly passed to the template. [1]: https://github.com/odoo/odoo/commit/f956e83c744bd9c970d3f16ce1cb3cff8bba2f6b task-3714768 closes odoo/odoo#152715 Signed-off-by: Romain Derie (rde) --- addons/website/static/src/js/editor/snippets.options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index fb7525e1154..99a6fac4545 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -247,7 +247,7 @@ const FontFamilyPickerUserValueWidget = SelectUserValueWidget.extend({ googleLocalFontsEls.forEach((el, index) => { $(el).append(renderToFragment('website.delete_google_font_btn', { index: index, - local: true, + local: "true", })); }); }