From 782360950069ef8a90b86af3a475007cbf2dd583 Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 22 Apr 2014 13:03:47 +1000 Subject: [PATCH] Fixes: U4-4682 Get EditorTemplates and DisplayTemplates working with RenderViewEngine --- src/Umbraco.Web/Mvc/RenderViewEngine.cs | 30 ++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Umbraco.Web/Mvc/RenderViewEngine.cs b/src/Umbraco.Web/Mvc/RenderViewEngine.cs index 1e49314429..8acca46d13 100644 --- a/src/Umbraco.Web/Mvc/RenderViewEngine.cs +++ b/src/Umbraco.Web/Mvc/RenderViewEngine.cs @@ -92,25 +92,25 @@ namespace Umbraco.Web.Mvc /// /// /// - private bool ShouldFindView(ControllerContext controllerContext, bool isPartial) - { - var umbracoToken = controllerContext.GetDataTokenInViewContextHierarchy("umbraco"); + private bool ShouldFindView(ControllerContext controllerContext, bool isPartial) + { + var umbracoToken = controllerContext.GetDataTokenInViewContextHierarchy("umbraco"); - //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; - } + //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) == false)) + { + return true; + } - //only find views if we're rendering the umbraco front end + //only find views if we're rendering the umbraco front end if (umbracoToken is RenderModel) - { - return true; - } + { + return true; + } - return false; - } + return false; + } } } \ No newline at end of file