Open dominik-markowski opened 4 years ago
Hi which version of glass are you using? The AB test issue was fixed in a recent version
Hi @muso31 I already updated to 5.8.170 and it fixed issues with controller renderings, but view rendering with are not working
And the project uses Sitecore 9.3
I am facing a similar issue in Sitecore 9.3 and latest version of Glass. My view renderings are not working when I set it up for A/B testing.
The issue is in Glass.Mapper.Sc.Pipelines.Response.GetModelFromView.GetDataSourceItem method. When component has a ab testing variant then: args.Rendering.DataSource is not a ID of valid datasource but a DataUri of rendering. I was trying to overwrite it but can get a valid datasource ID.
` protected override object GetDataSourceItem(GetModelArgs args, Type modelType) { var mvcContext = (IMvcContext) new MvcContext((ISitecoreService) new SitecoreService(Sitecore.Context.Database)); var rendering = args.Rendering; // rendering.DataSource is usually DataSource ID // BUT once variant is created for ab testing - rendering.DataSource is Data Uri to variant item version
`