London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

ViewComponentContext.ViewData no longer gets data

Vote:
 

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.
https://world.optimizely.com/support/bug-list/bug/CMS-32835

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

#318959
Mar 14, 2024 13:57
Vote:
 

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

#318961
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.
Vote:
 

The bugfix was released yesterday EPiServer.CMS.Core 12.21.1 (optimizely.com)

#319251
Mar 20, 2024 13:53
Vote:
 

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

#319318
Mar 21, 2024 12:56
Vote:
 

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

#319319
Mar 21, 2024 12:58
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.