Remove area datatoken from routedata #18
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Modified code checks previous 'area' value while restoring it back in the routedata, if previous value is null then remove the 'area' key from the route data otherwise routedata will have the 'area' key with null value and causes issues for subsequent controller/action execution in Siteore 7.5.

In Sitecore V7.5, Sitecore has added AppCenter area which has implementation for custom DependencyResolver (TagInjectionDependencyResolver) and ControllerFactory (TagInjectionControllerFactory), this custom controllerfactory implementation checks if controller request is for AppCenter area before passing it to MVC's implementation. While comparing the area value it throws object null exception if area value is null.
Sitecore 7.5 Method in question-
Class - TagInjectionControllerFactory
public bool CanHandle(RequestContext requestContext)
{
if (!requestContext.RouteData.DataTokens.ContainsKey("area"))
{
return false;
}
return string.Equals(requestContext.RouteData.DataTokens["area"].ToString(), this.areaName, StringComparison.InvariantCultureIgnoreCase);
}