Skip to content

Commit 6642ed0

Browse files
authored
Merge pull request #14487 from trentmwillis/qp-engines
[BUGFIX] Use routeName instead of fullRouteName in QP meta
2 parents 77c51f6 + a63e5fe commit 6642ed0

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

packages/ember-glimmer/tests/integration/application/engine-test.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ moduleFor('Application test: engine rendering', class extends ApplicationTest {
2222
this.registerEngine('blog', Engine.extend({
2323
init() {
2424
this._super(...arguments);
25-
this.register('template:application', compile('Engine{{outlet}}'));
25+
this.register('controller:application', Controller.extend({
26+
queryParams: ['lang'],
27+
lang: ''
28+
}));
29+
this.register('template:application', compile('Engine{{lang}}{{outlet}}'));
2630
this.register('route:application', Route.extend({
2731
model() {
2832
hooks.push('engine - application');
@@ -274,4 +278,12 @@ moduleFor('Application test: engine rendering', class extends ApplicationTest {
274278
this.assertText('ApplicationEngine');
275279
});
276280
}
281+
282+
['@test engine should lookup and use correct controller'](assert) {
283+
this.setupAppAndRoutableEngine();
284+
285+
return this.visit('/blog?lang=English').then(() => {
286+
this.assertText('ApplicationEngineEnglish');
287+
});
288+
}
277289
});

packages/ember-routing/lib/system/route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ let Route = EmberObject.extend(ActionHandler, Evented, {
172172
_qp: computed(function() {
173173
let controllerProto, combinedQueryParameterConfiguration;
174174

175-
let controllerName = this.controllerName || this.fullRouteName;
175+
let controllerName = this.controllerName || this.routeName;
176176
let definedControllerClass = getOwner(this)._lookupFactory(`controller:${controllerName}`);
177177
let queryParameterConfiguraton = get(this, 'queryParams');
178178
let hasRouterDefinedQueryParams = !!Object.keys(queryParameterConfiguraton).length;

0 commit comments

Comments
 (0)