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

fix issue with changeLanguage when route parameters are used #159

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hohler
Copy link

@hohler hohler commented Mar 19, 2019

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #151

(copied from issue) Using angular 7+ if a route as parameters, for example :name or :id, this method on this line "...Object.keys(snapshot.params).length ? [snapshot.params] : []," will add to the route the following ";name=valueofthename" or ";id=valueoftheid". There is another problem on the line above on the urlPart this urlPart I think needs to be splited by "/" otherwise if my route is something like "person/:name" the the result of calling the method changeLanguage that calls the traverseSnapshot will result in something like "lang/person%2Fvalueofthename;name=valueofthename".

What is the new behavior?

It will correctly assemble the route when changing the language and using route params.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

This is now an issue for over 3 months and nothing happened. I'm using this fix in production for this time and nothing broke. I think we are save to merge this PR without adding new tests.

Credits to cywolf (https://github.com/cywolf) for the fix!

@giacomo
Copy link

giacomo commented Apr 18, 2019

any news on this PR?

@omnibrain
Copy link

Why is this not merged yet?

@giacomo
Copy link

giacomo commented Jun 12, 2019

For all that are waiting for a release you can use:
patch-package to patch your application (https://www.npmjs.com/package/patch-package).

Attached the patch: unpack it and copy to patch folder
localize-router+2.0.0-RC.2.patch.zip

@hanneskaljuste
Copy link

Would also love to get this fix.

@pixelatorz
Copy link

any updates on when this will be merged?

@ntopulos
Copy link

This bug is still present in v1.0.0-rc.3 and this fix cannot be directly applied.

@meeroslav do you plan to fix this issue? It is quite a bug, as any real world application has route parameters.

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 this pull request may close these issues.

7 participants