Fixes IPublishedShapshot and friends

This commit is contained in:
Shannon
2018-04-27 11:38:50 +10:00
parent ad6a745681
commit 73567ffdce
34 changed files with 435 additions and 431 deletions

View File

@@ -54,7 +54,7 @@ namespace Umbraco.Web.Routing
}
if (node != null)
{
var d = DomainHelper.FindWildcardDomainInPath(frequest.UmbracoContext.PublishedShapshot.Domains.GetAll(true), node.Path, null);
var d = DomainHelper.FindWildcardDomainInPath(frequest.UmbracoContext.PublishedSnapshot.Domains.GetAll(true), node.Path, null);
if (d != null)
errorCulture = d.Culture;
}

View File

@@ -266,7 +266,7 @@ namespace Umbraco.Web.Routing
_logger.Debug<PublishedRouter>(() => $"{tracePrefix}Uri=\"{request.Uri}\"");
// try to find a domain matching the current request
var domainAndUri = DomainHelper.DomainForUri(request.UmbracoContext.PublishedShapshot.Domains.GetAll(false), request.Uri);
var domainAndUri = DomainHelper.DomainForUri(request.UmbracoContext.PublishedSnapshot.Domains.GetAll(false), request.Uri);
// handle domain - always has a contentId and a culture
if (domainAndUri != null)
@@ -311,7 +311,7 @@ namespace Umbraco.Web.Routing
var nodePath = request.PublishedContent.Path;
_logger.Debug<PublishedRouter>(() => $"{tracePrefix}Path=\"{nodePath}\"");
var rootNodeId = request.HasDomain ? request.Domain.ContentId : (int?)null;
var domain = DomainHelper.FindWildcardDomainInPath(request.UmbracoContext.PublishedShapshot.Domains.GetAll(true), nodePath, rootNodeId);
var domain = DomainHelper.FindWildcardDomainInPath(request.UmbracoContext.PublishedSnapshot.Domains.GetAll(true), nodePath, rootNodeId);
// always has a contentId and a culture
if (domain != null)
@@ -602,14 +602,14 @@ namespace Umbraco.Web.Routing
var loginPageId = publicAccessAttempt.Result.LoginNodeId;
if (loginPageId != request.PublishedContent.Id)
request.PublishedContent = request.UmbracoContext.PublishedShapshot.Content.GetById(loginPageId);
request.PublishedContent = request.UmbracoContext.PublishedSnapshot.Content.GetById(loginPageId);
}
else if (_services.PublicAccessService.HasAccess(request.PublishedContent.Id, _services.ContentService, GetRolesForLogin(membershipHelper.CurrentUserName)) == false)
{
_logger.Debug<PublishedRouter>(() => $"{tracePrefix}Current member has not access, redirect to error page");
var errorPageId = publicAccessAttempt.Result.NoAccessNodeId;
if (errorPageId != request.PublishedContent.Id)
request.PublishedContent = request.UmbracoContext.PublishedShapshot.Content.GetById(errorPageId);
request.PublishedContent = request.UmbracoContext.PublishedSnapshot.Content.GetById(errorPageId);
}
else
{