Try our conversational search powered by Generative AI!

ViewComponentContext.ViewData no longer gets data


We're using TechFellow.Optimizely.AdvancedContentArea for display options and up until recently it has been possible to read ""AdvancedContentArea__SelectedDisplayOption" from the ViewComponentContext.ViewData. After updating from 12.19.1 to 12.21.0 this has stopped working.  

protected override IViewComponentResult InvokeComponent(WebHighlightBlock currentContent)
	var displayOption = ViewComponentContext.ViewData["AdvancedContentArea__SelectedDisplayOption"] as EPiServer.Web.DisplayOption;
	var vm = new HighlightBlockViewModel
		HighlightList = currentContent.HighlightList,
		IgnoreBreakout = !_renderingHelperService.DisplayOptionIsFullWidth(displayOption?.Tag),
	return View(vm);

I saw there was a bugfix in the most recent update for the viewbag in blocks being empty, but this seems to be unrelated.

TechFellow.Optimizely.AdvancedContentArea has not been updated, so the issue is not here.

Mar 14, 2024 13:57

I think that might be related to bug CMS-32835 which should be fixed in CMS.Core 12.21 (hopefully release next week)

Mar 14, 2024 14:25
Thomas Nilsen - Mar 14, 2024 14:32
Oh, my bad!
I see now that the latest released version was 12.21.0, not 12.21.1 which is the version the bugfix for CMS-32835 ships with.
Hopefully that fixes my issue.

The bugfix was released yesterday EPiServer.CMS.Core 12.21.1 (

Mar 20, 2024 13:53

You probably want to make sure you updated EPiServer.Cms.AspNetCore.HtmlHelpers to 12.21.1, not just the cms.core

Mar 21, 2024 12:56

Everything is running as it should after the latest update, thanks :)

Mar 21, 2024 12:58
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.