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

Ember.Router: rootURL gets appended multiple times #1244

Closed
iStefo opened this issue Aug 8, 2012 · 11 comments · Fixed by #4312
Closed

Ember.Router: rootURL gets appended multiple times #1244

iStefo opened this issue Aug 8, 2012 · 11 comments · Fixed by #4312
Labels
Milestone

Comments

@iStefo
Copy link

iStefo commented Aug 8, 2012

When setting up a router using location: history and a rootURL: '/folder' the path on initial application launch will change to something like http://domain.com/folder/folder/folder (so 2 additional /folder/'s, but I have seen 5, too, already).

Paths then get correctly appended to the end of the URL.

I noticed this problem first on 0.9.8.1 and it continues on 1.0pre1. When using location: 'hash' it works flawlessly and also when not setting a rootURL at all, but then it will override my /folder, of course.

A possible workaround is to omit the rootURL and prepend /folder/ to every state directly in the root state. Feels a bit hacky, though...

It's very hard to extract demo-code from the project I'm currently working on but I may do so when I find some time and it's necessary for further debugging.

@digitaltoad
Copy link
Contributor

I'll look into this although rootURL was not part of 0.9.8.1 that I'm aware of.

@digitaltoad
Copy link
Contributor

There is definitely some kind of issue here although I'm not able to reproduce the stacking of the rootURL. I know you said that getting demo code from the current project would be hard, but if there is any way you can setup a very simple example that I can test that would be greatly appreciated.

@wagenet
Copy link
Member

wagenet commented Oct 19, 2012

Fixed by #1324.

@wagenet wagenet closed this as completed Oct 19, 2012
@pixelhandler
Copy link
Contributor

I see this issue happening again.

@stefanpenner stefanpenner reopened this Feb 5, 2014
@pixelhandler
Copy link
Contributor

@stefanpenner See : http://pixelhandler.github.io/ember-data-extensions/blog/

  • click between the archive and posts links

Source code is in a gist -> https://gist.github.com/pixelhandler/8831498

What's new about the bug this time is that the double rootURL only happens when the route's model hook returns a promise, returning an array works as expected. However when the model is async the transition results in a double rootURL e.g. '/blog/blog/posts/archive' (archive route, w/ async) as compared to 'blog/posts' (index route, no asyc).

@digitaltoad
Copy link
Contributor

This is indeed a problem in canary. I've tested between 1.4 beta and canary. The problem starts with canary. I'll take a look to see if I can find where this changed.

@jayphelps
Copy link
Contributor

@digitaltoad Which revision of 1.4 beta?

@digitaltoad
Copy link
Contributor

I tested beta 5.—
Joshua Borton

On Wed, Feb 5, 2014 at 9:12 PM, Jay Phelps notifications@github.com
wrote:

@digitaltoad Which version of 1.4 beta?

Reply to this email directly or view it on GitHub:
#1244 (comment)

@pixelhandler
Copy link
Contributor

@jayphelps I took your changes and updated the example app I shared with the fix for the link-to url, see : http://pixelhandler.github.io/ember-data-extensions/blog-fix/ looks good.

machty added a commit that referenced this issue Feb 6, 2014
[FEATURE ember-eager-url-update] link-to should generate the url if it eagerly updates it, not use the href because it includes rootURL. Fixes #1244
@dhatch
Copy link

dhatch commented Aug 13, 2014

Seeing this issue again on Ember 1.7.0-beta-5

@nickstinger
Copy link

Yes, its back in 1.7.0 release.

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