Skip to content

Commit

Permalink
[BUGFIX beta] sets the controller _qpDelegate
Browse files Browse the repository at this point in the history
before mapping all the queryParams. 

In certain scenarios, if query params are shared 
through a service, bound query params will 
fire the _qpDelegate while transitioning to a new
controller if the property has been modified from
it's default value. 

Loosely related to 
  - emberjs#11592

Based on a previous PR 
  - emberjs#13981
  • Loading branch information
rauhryan committed Oct 31, 2016
1 parent a9b22b1 commit 4699cdf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/ember-routing/lib/system/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,9 @@ let Route = EmberObject.extend(ActionHandler, Evented, {
let queryParams = get(this, '_qp');

let states = queryParams.states;

controller._qpDelegate = states.allowOverrides;

if (transition) {
// Update the model dep values used to calculate cache keys.
stashParamNames(this.router, transition.state.handlerInfos);
Expand All @@ -1337,8 +1340,6 @@ let Route = EmberObject.extend(ActionHandler, Evented, {
});
}

controller._qpDelegate = states.allowOverrides;

if (transition) {
let qpValues = getQueryParamsFor(this, transition.state);
controller.setProperties(qpValues);
Expand Down

0 comments on commit 4699cdf

Please sign in to comment.