From: Moriel Schottlender Date: Mon, 12 Jun 2017 12:56:17 +0000 (-0700) Subject: RCFilters: Retain extra url params when comparing url equivalency X-Git-Tag: 1.31.0-rc.0~3008^2 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=25df6e37eb5758afad5703c9655b94cc4be2135d;p=lhc%2Fweb%2Fwiklou.git RCFilters: Retain extra url params when comparing url equivalency The extra params should also dictate whether the URL should change, so we update parameters that are external to RCFilters' model, like limit and from, etc. Bug: T167551 Change-Id: I21e35e7871abbc57634231b6330cc1fad8299860 --- diff --git a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js index b7b46f6748..375b68b034 100644 --- a/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js +++ b/resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js @@ -638,6 +638,13 @@ // actual parameter visibility/representation in the URL currentFilterState = this.filtersModel.getFiltersFromParameters( uri.query ); updatedFilterState = this.filtersModel.getFiltersFromParameters( updatedUri.query ); + // HACK: Re-merge extra parameters in + // This is a hack and a quickfix; a better, more sustainable + // fix is being worked on with a UriProcessor, but for now + // we need to make sure the **comparison** of whether currentFilterState + // and updatedFilterState differ **includes** the extra parameters in the URL + currentFilterState = $.extend( true, {}, uri.query, currentFilterState ); + updatedFilterState = $.extend( true, {}, updatedUri.query, updatedFilterState ); // Include highlight states $.extend( true,