-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fixed incorrect node url being returned when no suitable domain exist… #10845
Fixed incorrect node url being returned when no suitable domain exist… #10845
Conversation
Hi there @vsilvar, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
@nikolajlauridsen Thanks for taking the time to look at the PR. With my latest commit the behavior should now be: I think this improves the current behavior but it's still not perfect due to the last case, which while completely correct in the CMS returns an incorrect Url with This last case could also be fixed by adding the following in
The downside being that the CMS message will default to the generic: Please let me know if the behavior makes sense now, and whether the additional fix mentioned above is preferred or not. |
Just did some more testing, and the behaviour after your changes is a significant improvement compared to what we currently have. In regards to the behaviour of I've tried to do as much testing as I can, and all seem to still work out fine, but just with more correct messages 👍 , of course, I can't possibly test every single edge case, so there might be some gremlins, however, I think that if we're going to change this behaviour, now is the time to do it since it's a new major, so I'll go ahead and merge this in. Amazing work, thanks a lot for your contribution 🎉 |
@nikolajlauridsen Also, just created #11032 as this PR was already merged and I noticed I was doing a case sensitive comparison of the cultures. |
…when_domain_not_set Improvement for #10845 - Changed culture comparison of domain to be case insensitive
I'm a little worried about the changes here because the functionality is now different from v8. I'm porting over some tests for v8, specifically with nested domains and these changes now make that fail so I fear this has introduced new issues. Preferably, we need to know if this issue existed in v8 and if so how to fix it there. @bergmania I think this may cause other underlying issues. The test specifically in v8 that I'm porting over is called // Set a current URL
const string url = "http://domain1.com/1001-1/1001-1-1";
// ... we then create an Umbraco context with this URL
// Then get the absolute URL for a node that exists under a node that has a domain assigned that is not the current domain
string absUrl = publishedUrlProvider.GetUrl(100111, UrlMode.Absolute);
// This will NOT pass because it's no longer respecting the domain.
Assert.AreEqual("http://domain2.com/1001-1-1/", absUrl); |
Actually, this might be an issue with my branch not being merged with the very latest. I'll report back if I still have the issue. |
Prerequisites
If there's an existing issue for this PR then this fixes #10827
Description
This changes the code to have a behavior close to what is expected while trying not to change to much.
Instead of always falling back to the first registered domain, we simply don't match one and use the default route.
This will more closely follow the default routing behavior and properly show it in the CMS as well.