From 9ef93ca1e090c609ecc9fc401218e45fca0764eb Mon Sep 17 00:00:00 2001 From: Maxim Medinskiy <mmedinskiy@ebay.com> Date: Tue, 7 Jul 2015 18:51:50 +0300 Subject: [PATCH] MAGETWO-39504: Stabilization of CMS grids --- .../Ui/view/base/web/js/grid/filters/filters.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js b/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js index ddd2bfffac2..13f6704f34d 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js @@ -151,11 +151,25 @@ define([ * @returns {Filters} Chainable. */ cancel: function () { + this.convertToObject(); this.set('filters', utils.copy(this.applied)); return this; }, + /** + * Convert empty array to empty object. + * + * @returns {Filters} Chainable. + */ + convertToObject: function() { + if ( _.isArray(this.applied) && _.isEmpty(this.applied) ) { + this.applied = {}; + } + + return this; + }, + /** * Tells wether filters pannel should be opened. * -- GitLab