From 845595b01b5f896c9557be91c4ba7c239e312270 Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Tue, 19 Feb 2013 05:39:38 +0600 Subject: [PATCH] Fixes: #U4-1727 --- src/Umbraco.Web/Mvc/RenderRouteHandler.cs | 14 +++++++------- src/Umbraco.Web/WebBootManager.cs | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web/Mvc/RenderRouteHandler.cs b/src/Umbraco.Web/Mvc/RenderRouteHandler.cs index 18f88ad54f..aa0c679124 100644 --- a/src/Umbraco.Web/Mvc/RenderRouteHandler.cs +++ b/src/Umbraco.Web/Mvc/RenderRouteHandler.cs @@ -182,12 +182,11 @@ namespace Umbraco.Web.Mvc //set the standard route values/tokens requestContext.RouteData.Values["controller"] = postedInfo.ControllerName; requestContext.RouteData.Values["action"] = postedInfo.ActionName; - requestContext.RouteData.DataTokens["area"] = postedInfo.Area; IHttpHandler handler = new MvcHandler(requestContext); //ensure the controllerType is set if found, meaning it is a plugin, not locally declared - if (postedInfo.Area != standardArea) + if (!postedInfo.Area.InvariantEquals(standardArea)) { //requestContext.RouteData.Values["controllerType"] = postedInfo.ControllerType; //find the other data tokens for this route and merge... things like Namespace will be included here @@ -196,12 +195,15 @@ namespace Umbraco.Web.Mvc var surfaceRoute = RouteTable.Routes.OfType() .SingleOrDefault(x => x.Defaults != null && x.Defaults.ContainsKey("controller") && - x.Defaults["controller"].ToString() == postedInfo.ControllerName && + x.Defaults["controller"].ToString().InvariantEquals(postedInfo.ControllerName) && x.DataTokens.ContainsKey("area") && - x.DataTokens["area"].ToString() == postedInfo.Area); + x.DataTokens["area"].ToString().InvariantEquals(postedInfo.Area)); if (surfaceRoute == null) throw new InvalidOperationException("Could not find a Surface controller route in the RouteTable for controller name " + postedInfo.ControllerName + " and within the area of " + postedInfo.Area); - //set the 'Namespaces' token so the controller factory knows where to look to construct it + + requestContext.RouteData.DataTokens["area"] = surfaceRoute.DataTokens["area"]; + + //set the 'Namespaces' token so the controller factory knows where to look to construct it if (surfaceRoute.DataTokens.ContainsKey("Namespaces")) { requestContext.RouteData.DataTokens["Namespaces"] = surfaceRoute.DataTokens["Namespaces"]; @@ -211,8 +213,6 @@ namespace Umbraco.Web.Mvc } - //store the original URL this came in on - requestContext.RouteData.DataTokens["umbraco-item-url"] = requestContext.HttpContext.Request.Url.AbsolutePath; //store the original route definition requestContext.RouteData.DataTokens["umbraco-route-def"] = routeDefinition; diff --git a/src/Umbraco.Web/WebBootManager.cs b/src/Umbraco.Web/WebBootManager.cs index 946137dc0c..9f8cec76b7 100644 --- a/src/Umbraco.Web/WebBootManager.cs +++ b/src/Umbraco.Web/WebBootManager.cs @@ -133,7 +133,7 @@ namespace Umbraco.Web //Create the REST/web/script service routes var webServiceRoutes = RouteTable.Routes.MapRoute( "Umbraco_web_services", - "Umbraco/RestServices/{controller}/{action}/{id}", + umbracoPath + "/RestServices/{controller}/{action}/{id}", new { controller = "SaveFileController", action = "Index", id = UrlParameter.Optional }, //look in this namespace for controllers new string[] { "Umbraco.Web.WebServices" }