Cleanup IPublishedContent
This commit is contained in:
@@ -104,8 +104,8 @@ namespace Umbraco.Web.PublishedCache.NuCache
|
||||
// hideTopLevelNode = support legacy stuff, look for /*/path/to/node
|
||||
// else normal, look for /path/to/node
|
||||
content = hideTopLevelNode.Value
|
||||
? GetAtRoot(preview).SelectMany(x => x.Children).FirstOrDefault(x => x.GetUrlName(_localizationService, culture) == parts[0])
|
||||
: GetAtRoot(preview).FirstOrDefault(x => x.GetUrlName(_localizationService, culture) == parts[0]);
|
||||
? GetAtRoot(preview).SelectMany(x => x.Children).FirstOrDefault(x => x.GetCulture(culture).UrlSegment == parts[0])
|
||||
: GetAtRoot(preview).FirstOrDefault(x => x.GetCulture(culture).UrlSegment == parts[0]);
|
||||
content = FollowRoute(content, parts, 1, culture);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
|
||||
// have to look for /foo (see note in ApplyHideTopLevelNodeFromPath).
|
||||
if (content == null && hideTopLevelNode.Value && parts.Length == 1)
|
||||
{
|
||||
content = GetAtRoot(preview).FirstOrDefault(x => x.GetUrlName(_localizationService, culture) == parts[0]);
|
||||
content = GetAtRoot(preview).FirstOrDefault(x => x.GetCulture(culture).UrlSegment == parts[0]);
|
||||
}
|
||||
|
||||
return content;
|
||||
@@ -147,9 +147,9 @@ namespace Umbraco.Web.PublishedCache.NuCache
|
||||
var hasDomains = _domainHelper.NodeHasDomains(n.Id);
|
||||
while (hasDomains == false && n != null) // n is null at root
|
||||
{
|
||||
var urlName = n.GetUrlName(_localizationService, culture);
|
||||
var urlSegment = n.GetCulture(culture).UrlSegment;
|
||||
|
||||
pathParts.Add(urlName);
|
||||
pathParts.Add(urlSegment);
|
||||
|
||||
// move to parent node
|
||||
n = n.Parent;
|
||||
@@ -178,14 +178,9 @@ namespace Umbraco.Web.PublishedCache.NuCache
|
||||
var part = parts[i++];
|
||||
content = content.Children.FirstOrDefault(x =>
|
||||
{
|
||||
// fixme - should use ISystemDefaultCultureAccessor NOT ILocalizationService!
|
||||
var urlName = x.GetUrlName(_localizationService, culture);
|
||||
return urlName == part;
|
||||
var urlSegment = x.GetCulture(culture).UrlSegment;
|
||||
return urlSegment == part;
|
||||
});
|
||||
|
||||
// fixme - if content has a wildcard domain, switch culture! or, shall we?
|
||||
// no - do NOT support wildcard domains, it makes no sense
|
||||
// OTOH support '*/en' as a valid domain
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user