Web.Routing, Web.Mvc - fix issues with content with no template

This commit is contained in:
Stephan
2013-05-03 20:09:14 -02:00
parent 294c2f4fba
commit 262aa3b8fe
2 changed files with 14 additions and 1 deletions

View File

@@ -101,6 +101,12 @@ namespace Umbraco.Web.Mvc
requestContext.RouteData.DataTokens.Add("umbraco-context", UmbracoContext); //required for UmbracoTemplatePage
}
private void UpdateRouteDataForRequest(RenderModel renderModel, RequestContext requestContext)
{
requestContext.RouteData.DataTokens["umbraco"] = renderModel;
// the rest should not change -- it's only the published content that has changed
}
/// <summary>
/// Checks the request and query strings to see if it matches the definition of having a Surface controller
/// posted value, if so, then we return a PostedDataProxyInfo object with the correct information.
@@ -358,7 +364,11 @@ namespace Umbraco.Web.Mvc
return handler;
// else we are running Mvc
// update the route definition
// update the route data - because the PublishedContent has changed
UpdateRouteDataForRequest(
new RenderModel(publishedContentRequest.PublishedContent, publishedContentRequest.Culture),
requestContext);
// update the route definition
routeDef = GetUmbracoRouteDefinition(requestContext, publishedContentRequest);
}

View File

@@ -66,7 +66,10 @@ namespace Umbraco.Web.Routing
/// </summary>
internal void UpdateOnMissingTemplate()
{
var __readonly = _readonly;
_readonly = false;
_engine.UpdateRequestOnMissingTemplate();
_readonly = __readonly;
}
/// <summary>