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

query-params-new: error in paramsFor() #4155

Closed
florent-blanvillain opened this issue Jan 15, 2014 · 5 comments
Closed

query-params-new: error in paramsFor() #4155

florent-blanvillain opened this issue Jan 15, 2014 · 5 comments

Comments

@florent-blanvillain
Copy link

Hi,

I get an error in paramsFor() at this line:
https://github.com/emberjs/ember.js/blob/master/packages/ember-routing/lib/system/route.js#L1321

params[colonized.split(':').pop()] = value;

"Sometimes", params is an Ember.Object so that I get:
Assertion Failed: You must use Ember.set() to access this property (of [object Object])

It happened after a transition at the same level (ie in the same router resource).

@florent-blanvillain
Copy link
Author

I know what you're talking about, I had the same problem : 'query-params-new' feature is partially activated unless the flag is set before ember loads.
But here this issue is inside the paramsFor method (but it might come from elsewhere).

@florent-blanvillain
Copy link
Author

As a quick fix, changing

params[colonized.split(':').pop()] = value;

by

set(params, colonized.split(':').pop(), value);

works for me.

@raytiley
Copy link
Contributor

@florent-blanvillain could you create a jsbin showing the issue?

@florent-blanvillain
Copy link
Author

Yes, here it is :
http://jsbin.com/UyuRoBiv/1/

florent-blanvillain added a commit to florent-blanvillain/ember.js that referenced this issue Jan 16, 2014
@raytiley
Copy link
Contributor

I'm dealing w/ a really slow internet connection so I can't really dig into this at the moment. My gut tells me that using set() shouldn't be necessary there. The queryParams object comes from router.js / route-recognizer which are both Ember agnostic libraries. Therefore those objects shouldn't be Ember.objects.

I'll try to look at this tonight if I can.

cc @machty

@machty machty closed this as completed in 6a7b7cd Jan 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants