Fixed merge issue
This commit is contained in:
@@ -120,40 +120,7 @@ namespace Umbraco.Web.Mvc
|
||||
return new Attempt<RouteDefinition>(
|
||||
new InvalidOperationException("Cannot find the Umbraco route definition in the route values, the request must be made in the context of an Umbraco request"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// we need to recursively find the route definition based on the parent view context
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <remarks>
|
||||
/// We may have Child Actions within Child actions so we need to recursively look this up.
|
||||
/// see: http://issues.umbraco.org/issue/U4-1844
|
||||
/// </remarks>
|
||||
private Attempt<RouteDefinition> TryGetRouteDefinitionFromAncestorViewContexts()
|
||||
{
|
||||
ControllerContext currentContext = ControllerContext;
|
||||
while (currentContext != null)
|
||||
{
|
||||
var currentRouteData = currentContext.RouteData;
|
||||
if (currentRouteData.DataTokens.ContainsKey("umbraco-route-def"))
|
||||
{
|
||||
return new Attempt<RouteDefinition>(true, (RouteDefinition)currentRouteData.DataTokens["umbraco-route-def"]);
|
||||
}
|
||||
if (currentContext.IsChildAction)
|
||||
{
|
||||
//assign current context to parent
|
||||
currentContext = currentContext.ParentActionViewContext;
|
||||
}
|
||||
else
|
||||
{
|
||||
//exit the loop
|
||||
currentRouteData = null;
|
||||
}
|
||||
}
|
||||
return new Attempt<RouteDefinition>(
|
||||
new InvalidOperationException("Cannot find the Umbraco route definition in the route values, the request must be made in the context of an Umbraco request"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user