Problem
The problem was caused by the Sitecore.Forms.Mvc.config file. I hadn't mentioned WFFM in my original question because I assumed that it wouldn't affect DMS.
When you enable DMS without WFFM the getRenderer pipeline looks like this:
<mvc.getRenderer patch:source="Glass.Mapper.Sc.Mvc.config">
<processor type="Sitecore.Mvc.Analytics.Pipelines.Response.GetRenderer.CustomizeRendering, Sitecore.Mvc.Analytics" patch:source="Sitecore.MvcAnalytics.config"/>
<processor type="Sitecore.Mvc.Pipelines.Response.GetRenderer.GetViewRenderer, Sitecore.Mvc" patch:source="Sitecore.Mvc.config"/>
<processor type="Sitecore.Mvc.Pipelines.Response.GetRenderer.GetItemRenderer, Sitecore.Mvc" patch:source="Sitecore.Mvc.config"/>
<processor type="Sitecore.Mvc.Pipelines.Response.GetRenderer.GetXsltRenderer, Sitecore.Mvc" patch:source="Sitecore.Mvc.config"/>
<processor type="Sitecore.Mvc.Pipelines.Response.GetRenderer.GetControllerRenderer, Sitecore.Mvc" patch:source="Sitecore.Mvc.config"/>
<processor type="Sitecore.Mvc.Pipelines.Response.GetRenderer.GetMethodRenderer, Sitecore.Mvc" patch:source="Sitecore.Mvc.config"/>
<processor type="Sitecore.Mvc.Pipelines.Response.GetRenderer.GetUrlRenderer, Sitecore.Mvc" patch:source="Sitecore.Mvc.config"/>
<processor type="Sitecore.Mvc.Pipelines.Response.GetRenderer.GetDefaultRenderer, Sitecore.Mvc" patch:source="Sitecore.Mvc.config"/>
</mvc.getRenderer>
You can see here that the first entry is a processor that analytics inserts to control personalisation. If we now enable the Sitecore.Forms.Mvc.config this pipeline changes to this:
<mvc.getRenderer patch:source="Glass.Mapper.Sc.Mvc.config">
<processor type="Sitecore.Forms.Mvc.Pipelines.GetFormControllerRenderer, Sitecore.Forms.Mvc" patch:source="Sitecore.Forms.Mvc.config"/>
<processor type="Sitecore.Mvc.Analytics.Pipelines.Response.GetRenderer.CustomizeRendering, Sitecore.Mvc.Analytics" patch:source="Sitecore.MvcAnalytics.config"/>
<processor type="Sitecore.Mvc.Pipelines.Response.GetRenderer.GetViewRenderer, Sitecore.Mvc" patch:source="Sitecore.Mvc.config"/>
<processor type="Sitecore.Mvc.Pipelines.Response.GetRenderer.GetItemRenderer, Sitecore.Mvc" patch:source="Sitecore.Mvc.config"/>
<processor type="Sitecore.Mvc.Pipelines.Response.GetRenderer.GetXsltRenderer, Sitecore.Mvc" patch:source="Sitecore.Mvc.config"/>
<processor type="Sitecore.Mvc.Pipelines.Response.GetRenderer.GetControllerRenderer, Sitecore.Mvc" patch:source="Sitecore.Mvc.config"/>
<processor type="Sitecore.Mvc.Pipelines.Response.GetRenderer.GetMethodRenderer, Sitecore.Mvc" patch:source="Sitecore.Mvc.config"/>
<processor type="Sitecore.Mvc.Pipelines.Response.GetRenderer.GetUrlRenderer, Sitecore.Mvc" patch:source="Sitecore.Mvc.config"/>
<processor type="Sitecore.Mvc.Pipelines.Response.GetRenderer.GetDefaultRenderer, Sitecore.Mvc" patch:source="Sitecore.Mvc.config"/>
</mvc.getRenderer>
Notice that the WFFM Forms MVC entry inserts itself at the start of the pipeline. This causes problems because it returns a rendering:
protected override Renderer GetRenderer(Rendering rendering, GetRendererArgs args)
{
if (args.Rendering.RenderingItem.ID != IDs.FormMvcInterpreterID)
return base.GetRenderer(rendering, args);
Tuple<string, string> controllerAndAction = this.GetControllerAndAction(rendering, args);
if (controllerAndAction == null)
return (Renderer) null;
string str1 = controllerAndAction.Item1;
string str2 = controllerAndAction.Item2;
FormControllerRenderer controllerRenderer = new FormControllerRenderer();
controllerRenderer.ControllerName = str1;
controllerRenderer.ActionName = str2;
return (Renderer) controllerRenderer;
}
The CustomiseRendering processor then does nothing because there is a returned result, therefore no personalization is performed:
public override void Process(GetRendererArgs args)
{
Assert.ArgumentNotNull((object) args, "args");
if (args.Result != null || args.Rendering == null || string.IsNullOrEmpty(args.Rendering["RenderingXml"]))
return;
CustomizeRenderingArgs args1 = new CustomizeRenderingArgs(args.Rendering);
args.Result = PipelineService.Get().RunPipeline<CustomizeRenderingArgs, Renderer>("mvc.customizeRendering", args1, (Func<CustomizeRenderingArgs, Renderer>) (pipelineArgs => pipelineArgs.Renderer));
}
Cause:
This is caused by the order that the MVC, Web Forms and Analytics configs are loaded. By default they are loaded in this order:
- Sitecore.Forms.Mvc.config
- Sitecore.Mvc.config
- Sitecore.MvcAnalytics.config
This is the correct order.
Solution:
The solution is to rename the Sitecore.Forms.Mvc.Config to y.Sitecore.Forms.Mvc.config to force it to be loaded last.