Files
odoo_source/addons/website/static
Arthur Detroux (ard) da9b81f28d [FIX] website: fix snippet social media values cache
This `s_social_media` snippet option uses a variable defined in the
module's scope to store social media values. This
reduces the amount of RPCs needed to fetch the data as they will only be
done once per edition.

Prior to commit [1], this cache would only exist as long as the page
lived. Which means that switching website, switching page or going in
the backend would reset its value. Commit [1] moved the edition in the
backend which means that the cache would persist between pages but more
importantly, between websites, only resetting if the backend was
refreshed or left.

Steps to reproduce:
- Go on website 1
- Modify the URL for facebook in the footer
- Go on website 2
- The value is the same when it should still be facebook.com/Odoo

This commit fixes that by resetting the cache when the editor is
destroyed.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

closes odoo/odoo#103689

X-original-commit: 3efb726575679f62f9ee2894193323bfe45d7938
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-10-20 19:09:57 +02:00
..