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

_array_ queryParam converted to _string_ after transitionTo #13591

Closed
arturkot opened this issue Jun 3, 2016 · 6 comments
Closed

_array_ queryParam converted to _string_ after transitionTo #13591

arturkot opened this issue Jun 3, 2016 · 6 comments

Comments

@arturkot
Copy link

arturkot commented Jun 3, 2016

Hi,

a demo: https://ember-twiddle.com/650b6fb3657bf037a40170f3b1e74b84

Steps to reproduce (here's a quick video: https://v.usetapes.com/V0vlZepqbw):

  1. Use "My Route!" link.
  2. Click either "Set array" or "Set all" to update the array parameter.
  3. The array parameter is now a string (and should remain an array).

Notes:

  • "my-route" route uses application controller controllerName: 'application' to access query parameters from the parent route/controller.
  • When you comment out this.transitionTo('application') setting parameters will work as expected (array parameter remains an array).
  • "reset params" sets an empty array and that doesn't trigger the error.
  • I've noticed the error after updating from Ember 2.4.1 to 2.4.5. I can confirm that 2.4.1 doesn't have this error.

Thanks,

Artur

@vomchik
Copy link

vomchik commented Jun 5, 2016

Ember 2.5.1 has the some problem.

@lolmaus
Copy link
Contributor

lolmaus commented Jun 5, 2016

This issue has been mentioned here: #13273 (comment)

@acorncom
Copy link
Contributor

@arturkot Further background can be found #13600 Your issue should be resolved with 2.4.6 (as the changes that were the issue were reverted).

For Ember 2.5+ I'm unclear on whether this issue continues to be a problem or not in the latest versions.

I'll close this issue for now

@arturkot
Copy link
Author

Big thanks for looking into that!

@lolmaus
Copy link
Contributor

lolmaus commented Jun 14, 2016

@acorncom

For Ember 2.5+ I'm unclear on whether this issue continues to be a problem or not in the latest versions.

Quoting @Sinled from #13273 (comment) :

2.4.6 fixed my problem with query params serialisation, but it still present in 2.6.0

@lan0
Copy link
Contributor

lan0 commented Jul 30, 2016

Can this issue be reopened?

The behavior of the twiddle in the OP differs slightly in 2.6.2 and 2.7.0:
While in 2.6.2 the array got converted to a string immediately after clicking on Set array, in 2.7.0 the initial Set array works fine but a subsequent click on Set number transforms the array into a string.

lan0 added a commit to lan0/ember.js that referenced this issue Aug 31, 2016
`"[1]"` gets stringified in a subsequent call to `serializeQueryParam`, resulting in the serialized param being `""[1]""` instead of `"[1]"`.

This fixes emberjs#13591 and is similar to emberjs#13816.
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

Successfully merging a pull request may close this issue.

5 participants