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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user