Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

queryParams name conflict when nested route uses same controller as outer route #14835

Closed
kbullaughey opened this issue Jan 12, 2017 · 2 comments

Comments

@kbullaughey
Copy link

kbullaughey commented Jan 12, 2017

I am attempting to upgrade from Ember 2.3 to 2.10 and encountered a problem when I have a route nested inside another route and both use the same controller, and that controller has a query parameter.

I have created an ember twiddle to reproduce the problem.

When I go to the route /outer/inner I get the following error:

Assertion Failed: You're not allowed to have more than one controller property map to the same query param key, but both `outer:token` and `outer:token` map to `token`. You can fix this by mapping one of the controller properties to a different query param key via the `as` config option, e.g. `token: { as: 'other-token' }`

It seems the method, _queryParamsFor where this method is raised doesn't consider the fact the two controllers are the same, and that maybe this should be okay.

I don't actually know if it should be okay, but if there some reason this can't work, it means you can't use query parameters at all when a nested route uses the same controller as the outer one. This is a motif I have employed extensively throughout my app and it used to work.

@ghost
Copy link

ghost commented Jan 18, 2017

@kbullaughey this sounds quite similar to #14560 which has been fixed but not yet released in a beta version. For our app, I was able to pull down a copy of this repo and build v2.11.0-beta.4 cherry picked with the changes from commits that fixed 14560. If you can, I'd recommend going this route for a quick test.

@kbullaughey
Copy link
Author

Seems you are correct. I can switch the fiddle to canary (and even beta now) and the problem is gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants