From 3482e3a5a79fa3a950e506fb7afb9d1522c33ff8 Mon Sep 17 00:00:00 2001 From: Vincent Schippefilt Date: Wed, 6 Mar 2019 14:02:35 +0100 Subject: [PATCH] [REF] website_forum: adapt code after jQuery update Part of task 1896658 Co-authored-by: Aaron Bohy Co-authored-by: Christophe Matthieu Co-authored-by: Mathieu Duckerts-Antoine Co-authored-by: David Monjoie Co-authored-by: Martin Geubelle Co-authored-by: svs-odoo Co-authored-by: Vincent Schippefilt --- .../website_forum/static/src/js/website_forum.editor.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/website_forum/static/src/js/website_forum.editor.js b/addons/website_forum/static/src/js/website_forum.editor.js index 870878f0331..e2b19ba681f 100644 --- a/addons/website_forum/static/src/js/website_forum.editor.js +++ b/addons/website_forum/static/src/js/website_forum.editor.js @@ -21,7 +21,7 @@ WebsiteNewMenu.include({ * and redirects the user to this new forum. * * @private - * @returns {Deferred} Unresolved if there is a redirection + * @returns {Promise} Unresolved if there is a redirection */ _createNewForum: function () { var self = this; @@ -42,7 +42,9 @@ WebsiteNewMenu.include({ $add.find('label').append(_t("Add to menu")); $group.after($add); } - }).then(function (forum_name, field, $dialog) { + }).then(function (result) { + var forum_name = result.val; + var $dialog = result.dialog; if (!forum_name) { return; } @@ -55,7 +57,7 @@ WebsiteNewMenu.include({ }, }).then(function (url) { window.location.href = url; - return $.Deferred(); + return new Promise(function () {}); }); }); },