Fixes routing tests and reverts to simplified routing logic based on the Language ISO code returned from the IDomain object.
This commit is contained in:
@@ -80,25 +80,14 @@ namespace Umbraco.Web.Models
|
||||
: domainHelper.DomainForNode(int.Parse(route.Substring(0, pos)), current).UmbracoDomain;
|
||||
}
|
||||
|
||||
if (domain == null)
|
||||
if (domain == null || domain.LanguageIsoCode.IsNullOrWhiteSpace())
|
||||
return GetDefaultCulture(localizationService);
|
||||
|
||||
//NOTE: The domain service IDomain model has changed and no longer holds a reference to IContent or ILanguage to
|
||||
// improve performance, this means that we need to lookup the language below, but this was already the case previously
|
||||
// in the repository and since the language lookup is cached it should be ok. If we want however we could create
|
||||
// another method on the DomainService to return domains with their culture info on them
|
||||
var wcDomain = DomainHelper.FindWildcardDomainInPath(domainService.GetAll(true), contentPath, domain.RootContentId);
|
||||
if (wcDomain != null && wcDomain.LanguageIsoCode.IsNullOrWhiteSpace() == false)
|
||||
{
|
||||
return new CultureInfo(wcDomain.LanguageIsoCode);
|
||||
}
|
||||
|
||||
if (domain.LanguageIsoCode.IsNullOrWhiteSpace() == false)
|
||||
{
|
||||
return new CultureInfo(domain.LanguageIsoCode);
|
||||
}
|
||||
|
||||
return GetDefaultCulture(localizationService);
|
||||
return wcDomain == null
|
||||
? new CultureInfo(domain.LanguageIsoCode)
|
||||
: new CultureInfo(wcDomain.LanguageIsoCode);
|
||||
}
|
||||
|
||||
private static CultureInfo GetDefaultCulture(ILocalizationService localizationService)
|
||||
|
||||
Reference in New Issue
Block a user