From 5e1074340ff6d0bb9797779b9dbc4de3fe653844 Mon Sep 17 00:00:00 2001 From: xO-Tx Date: Wed, 21 Dec 2022 14:51:55 +0000 Subject: [PATCH] [FIX] website: fix missing space on whatsapp text for "share" block To reproduce the issue: - Website > Edit mode > Add "Share" block > Save. - Click WhatsApp > Missing space between page title and its URL. Starting from [1], the `$('title').text()` value was replaced on "Share" snippet by `document.title` (which will trim and collapse whitespaces in the page title). This leads to a missing space between page title and the shared URL. After this commit, the correct spacing is restored. [1]: https://github.com/odoo/odoo/commit/ddb2c06be4196c86ff6a2fd74874487d75b31c94 opw-3084367 X-original-commit: e7e9eb4f806680b19f3ec61fb080316a3160e7fb Part-of: odoo/odoo#108724 --- addons/website/static/src/snippets/s_share/000.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/static/src/snippets/s_share/000.js b/addons/website/static/src/snippets/s_share/000.js index 0d0558a22b0..c3f1a29c8f8 100644 --- a/addons/website/static/src/snippets/s_share/000.js +++ b/addons/website/static/src/snippets/s_share/000.js @@ -63,7 +63,7 @@ const ShareWidget = publicWidget.Widget.extend({ // parameter, merging everything together, e.g of output: // https://wa.me/?text=%20OpenWood%20Collection%20Online%20Reveal%20%7C%20My%20Website%20http%3A%2F%2Flocalhost%3A8888%2Fevent%2Fopenwood-collection-online-reveal-2021-06-21-2021-06-23-8%2Fregister // For more details, see https://faq.whatsapp.com/general/chats/how-to-use-click-to-chat/ - return a + title + url + c; + return `${a + title}%20${url + c}`; } return a + title + c; })