Merge remote-tracking branch 'origin/7.3.0' into dev-v8

Conflicts:
	src/Umbraco.Core/Umbraco.Core.csproj
	src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs
	src/Umbraco.Tests/Routing/ContentFinderByAliasTests.cs
	src/Umbraco.Tests/Routing/ContentFinderByAliasWithDomainsTests.cs
	src/Umbraco.Tests/Routing/ContentFinderByNiceUrlWithDomainsTests.cs
	src/Umbraco.Tests/Routing/DomainsAndCulturesTests.cs
	src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs
	src/Umbraco.Tests/Routing/uQueryGetNodeIdByUrlTests.cs
	src/Umbraco.Web/Cache/CacheRefresherEventHandler.cs
	src/umbraco.MacroEngines/packages.config
	src/umbraco.MacroEngines/umbraco.MacroEngines.csproj
	src/umbraco.cms/businesslogic/Property/Property.cs
	src/umbraco.cms/businesslogic/datatype/DataTypeDefinition.cs
This commit is contained in:
Shannon
2015-01-23 12:25:07 +11:00
127 changed files with 3184 additions and 1995 deletions

View File

@@ -58,10 +58,12 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
content = content ?? DetermineIdByRoute(umbracoContext, preview, route, hideTopLevelNode.Value);
// cache if we have a content and not previewing
if (content != null && !preview)
if (content != null && preview == false)
{
var domainRootNodeId = route.StartsWith("/") ? -1 : int.Parse(route.Substring(0, route.IndexOf('/')));
var iscanon = !UnitTesting && !DomainHelper.ExistsDomainInPath(DomainHelper.GetAllDomains(false), content.Path, domainRootNodeId);
var iscanon =
UnitTesting == false
&& DomainHelper.ExistsDomainInPath(umbracoContext.Application.Services.DomainService.GetAll(false), content.Path, domainRootNodeId) == false;
// and only if this is the canonical url (the one GetUrl would return)
if (iscanon)
_routesCache.Store(contentId, route);
@@ -83,7 +85,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
route = DetermineRouteById(umbracoContext, preview, contentId);
// cache if we have a route and not previewing
if (route != null && !preview)
if (route != null && preview == false)
_routesCache.Store(contentId, route);
return route;
@@ -124,12 +126,14 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
if (node == null)
return null;
var domainHelper = new DomainHelper(umbracoContext.Application.Services.DomainService);
// walk up from that node until we hit a node with a domain,
// or we reach the content root, collecting urls in the way
var pathParts = new List<string>();
var n = node;
var hasDomains = DomainHelper.NodeHasDomains(n.Id);
while (!hasDomains && n != null) // n is null at root
var hasDomains = domainHelper.NodeHasDomains(n.Id);
while (hasDomains == false && n != null) // n is null at root
{
// get the url
var urlName = n.UrlName;
@@ -137,11 +141,11 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
// move to parent node
n = n.Parent;
hasDomains = n != null && DomainHelper.NodeHasDomains(n.Id);
hasDomains = n != null && domainHelper.NodeHasDomains(n.Id);
}
// no domain, respect HideTopLevelNodeFromPath for legacy purposes
if (!hasDomains && global::umbraco.GlobalSettings.HideTopLevelNodeFromPath)
if (hasDomains == false && global::umbraco.GlobalSettings.HideTopLevelNodeFromPath)
ApplyHideTopLevelNodeFromPath(umbracoContext, node, pathParts);
// assemble the route