Reverting 221bfa5f3d so that views are found in partials again

Tested creating/editing members with custom properties in combination with our snippets and
that seems to work fine now, so not sure what this was supposed to fix.
Fixes U4-4604 Surface Controller functionality changed in 7.1 breaking site
This commit is contained in:
Sebastiaan Janssen
2014-04-07 12:16:45 +02:00
parent 08d74e3320
commit fcb080658d

View File

@@ -92,25 +92,27 @@ namespace Umbraco.Web.Mvc
/// <param name="controllerContext"></param>
/// <param name="isPartial"></param>
/// <returns></returns>
private bool ShouldFindView(ControllerContext controllerContext, bool isPartial)
{
var umbracoToken = controllerContext.GetDataTokenInViewContextHierarchy("umbraco");
private bool ShouldFindView(ControllerContext controllerContext, bool isPartial)
{
//first check if we're rendering a partial view for the back office, or surface controller, etc...
//anything that is not IUmbracoRenderModel as this should only pertain to Umbraco views.
if (isPartial
&& controllerContext.RouteData.DataTokens.ContainsKey("umbraco")
&& !(controllerContext.RouteData.DataTokens["umbraco"] is RenderModel))
{
return true;
}
//first check if we're rendering a partial view for the back office, or surface controller, etc...
//anything that is not IUmbracoRenderModel as this should only pertain to Umbraco views.
if (isPartial && umbracoToken is RenderModel)
{
return true;
}
//only find views if we're rendering the umbraco front end
if (controllerContext.RouteData.DataTokens.ContainsKey("umbraco")
&& controllerContext.RouteData.DataTokens["umbraco"] != null
&& controllerContext.RouteData.DataTokens["umbraco"] is RenderModel)
{
return true;
}
//only find views if we're rendering the umbraco front end
if (umbracoToken is RenderModel)
{
return true;
}
return false;
}
return false;
}
}
}