From ee94decd30c4514d5bc410b1652bc6464bb600aa Mon Sep 17 00:00:00 2001 From: Priyanka Kakadiya Date: Wed, 20 Mar 2019 06:31:46 +0000 Subject: [PATCH] [FIX] web: disable sanitization for bootstrap popover Since saas-11.3: Bootstrap sanitizer sanitizes html and removes attributes which are not defined in whitelist, here is the documentation link: https://getbootstrap.com/docs/4.3/getting-started/javascript/#sanitizer Restore sanitize=false for bootstrap popover. A scenario where the sanitizer will break a popover: compare 2 products and open Compare popover and try to delete a comparison item from the popover -> item can not be deleted because data-product_product_id has been removed by sanitizer and so the item can not be deleted because deletion logic depends on data-product_product_id. Reference commit: https://github.com/odoo/odoo/commit/36caf5fc16b5a95a0bf37f08f0caf974683b2df6 Closes https://github.com/odoo/odoo/pull/31961 task-1950702 --- addons/web/static/src/js/libs/bootstrap.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/libs/bootstrap.js b/addons/web/static/src/js/libs/bootstrap.js index 9db99815009..b91728b22d1 100644 --- a/addons/web/static/src/js/libs/bootstrap.js +++ b/addons/web/static/src/js/libs/bootstrap.js @@ -6,7 +6,7 @@ odoo.define('web.bootstrap.extensions', function () { * patching in place. */ -/* Bootstrap defaults overwrite */ +/* Bootstrap tooltip defaults overwrite */ $.fn.tooltip.Constructor.Default.placement = 'auto'; $.fn.tooltip.Constructor.Default.fallbackPlacement = ['bottom', 'right', 'left', 'top']; $.fn.tooltip.Constructor.Default.html = true; @@ -24,4 +24,8 @@ $.fn.tooltip.Constructor.prototype.show = function () { return bootstrapShowFunction.call(this); }; + +/* Bootstrap popover defaults overwrite */ +$.fn.popover.Constructor.Default.sanitize = false; + });