Fixes up pull request so that there is no breaking changes. We now type check for a new base class called

UmbracoControllerFactory to get the controller type. Adds SurfaceRouteHandler to ensure that UmbracoMvcHandler is used for all SurfaceControllers, and updates
all routes accordingly. Streamlines the RenderRouteHandler to then just look up surface routes in the route table
for posted values. This now ensures that UmbracoMvcHandler is used even with plugin surface controllers.
This commit is contained in:
Shannon Deminick
2013-02-19 07:30:46 +06:00
parent 55f06a7ca6
commit d8721197b7
10 changed files with 165 additions and 125 deletions

View File

@@ -26,7 +26,7 @@ namespace Umbraco.Web.Mvc
/// <param name="umbracoTokenValue">The DataToken value to set for the 'umbraco' key, this defaults to 'backoffice' </param>
/// <remarks>
/// </remarks>
internal static void RouteControllerPlugin(this AreaRegistration area, string controllerName, Type controllerType, RouteCollection routes,
internal static Route RouteControllerPlugin(this AreaRegistration area, string controllerName, Type controllerType, RouteCollection routes,
string controllerSuffixName, string defaultAction, object defaultId,
string umbracoTokenValue = "backoffice")
{
@@ -72,6 +72,7 @@ namespace Umbraco.Web.Mvc
controllerPluginRoute.DataTokens.Add("area", area.AreaName);
controllerPluginRoute.DataTokens.Add("umbraco", umbracoTokenValue); //ensure the umbraco token is set
return controllerPluginRoute;
}
}
}