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

Unable to override serializeQueryParam within route #11288

Open
joshfarrant opened this issue May 27, 2015 · 7 comments
Open

Unable to override serializeQueryParam within route #11288

joshfarrant opened this issue May 27, 2015 · 7 comments

Comments

@joshfarrant
Copy link

It seems like any overrides applied to the serializeQueryParam method in a route aren't being applied.

For example I could set someQueryParam: 1 in the controller, then have something like this in the route (unrealistic but I'd have expected it to work):

serializeQueryParam: function(value, urlKey, defaultValueType) {
     return 20;
},

I'd expect the resulting param in the request to look something like this.

?someQueryParam=20

However it remains like this

?someQueryParam=1

Is this expected?

@trek trek self-assigned this Jun 29, 2015
@exupero
Copy link

exupero commented Apr 19, 2016

I'm seeing the same behavior using Ember 2.4. The method is called, but doesn't appear to have any effect.

I see several examples of using serializeQueryParam on GitHub, but all using Ember 1.

@trek trek removed their assignment Sep 29, 2016
@denzo
Copy link

denzo commented Jan 10, 2017

Any updates on this? @mmun @trek

@denzo
Copy link

denzo commented Jan 10, 2017

I see that serializeQueryParam is marked as @private. Is that intentional and means that I should avoid overriding it?

https://github.com/emberjs/ember.js/blob/v2.10.0/packages/ember-routing/lib/system/route.js#L430

@ming-codes
Copy link
Contributor

Any update on this? serializeQueryParam seems to work for me, but I'm also curious why it's marked as private.

@acorncom
Copy link
Contributor

acorncom commented Mar 8, 2017

@denzo @ming-codes Was asking about this myself this morning. Per @rwjblue on Slack, this may not be public but it's at least "intimate API" (i.e. can't be broken). So probably safe to use (see #14979 for work on the router service that includes tests for it).

@joshfarrant @exupero If this is still a problem for you, it'd be quite helpful to get a reproduction on Twiddle so we can check this more carefully. Thanks!

@pixelhandler
Copy link
Contributor

@acorncom @denzo @exupero @joshfarrant @ming-codes @mmun @pixelhandler @rwjblue @trek is this still an issue, perhaps we should close; what do you think?

@acorncom
Copy link
Contributor

@pixelhandler given the fact that serializeQueryParam is listed in Ed's PR tracking public API here (https://github.com/emberjs/ember.js/pull/16910/files#diff-d6b0c0d618513a72b8aec4c128e8b345R471), I think it remains an open question whether we're supporting this or not. As such, I don't think we should close this just yet.

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

9 participants