From a40236d38a8f178b21d674e22aab5120bcce034c Mon Sep 17 00:00:00 2001 From: rde Date: Thu, 21 Sep 2017 11:58:18 +0200 Subject: [PATCH] [FIX] website: SEO keywords Seen behavior: SEO keywords not saving Expecte behavior: SEO should save Reason: destroy event method from dialog.js is now hidding modal programmatically. Which at the end call twice the keywords save method. The second time there were no keywords passed to that function which is causing that behavior (saving empty array). --- addons/website/static/src/js/menu/seo.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/website/static/src/js/menu/seo.js b/addons/website/static/src/js/menu/seo.js index 2a85b49bd59..c53afcbe016 100644 --- a/addons/website/static/src/js/menu/seo.js +++ b/addons/website/static/src/js/menu/seo.js @@ -455,6 +455,7 @@ var SeoConfigurator = Dialog.extend({ data.website_meta_keywords = this.keywordList.keywords().join(', '); } this.saveMetaData(data).then(function () { + self.htmlPage.changeKeywords(self.keywordList.keywords()); self.close(); }); }, @@ -546,10 +547,6 @@ var SeoConfigurator = Dialog.extend({ $preview.empty(); preview.appendTo($preview); }, - destroy: function () { - this.htmlPage.changeKeywords(this.keywordList.keywords()); - this._super.apply(this, arguments); - }, updateTable : function (removed) { var self = this, val = removed ? (this.$el.find('tbody > tr').length - 1) : (this.$el.find('tbody > tr').length);