We’re on UE 5.4 , but looking at the 5.8 dev branch on GitHub, UMVVMBlueprintViewExtension_ListViewBase::Precompile and Compile still appear to have the same issue.
Problem:
ListView entry widget viewmodel bindings silently fail in cooked builds when using MVVM bindings to bind an array to SetListItems.
Root cause:
In UMVVMBlueprintViewExtension_ListViewBase::Precompile and Compile, the code accesses EntryWidgetClass->ClassDefaultObject to get the entry widget’s blueprint view. During cooking, blueprint compilation order does not guarantee that the entry widget class has been fully compiled before the containing widget. When the CDO is null, the compiler silently skips creating the runtime UMVVMViewListViewBaseExtension, so entry widget bindings never work.
Our fix:
The CDO was only used to reach CDO->GetClass()->ClassGeneratedBy. No instance data on the CDO was ever read. We changed GetEntryWidgetBlueprintView to take a const UClass* instead of const UUserWidget* and access EntryWidgetClass->ClassGeneratedBy directly, bypassing the CDO entirely.
Before:
if (const UUserWidget* EntryUserWidget = Cast<UUserWidget>(EntryWidgetClass->ClassDefaultObject))
{
if (const UMVVMBlueprintView* EntryBPView = GetEntryWidgetBlueprintView(EntryUserWidget))
After:
if (const UMVVMBlueprintView* EntryBPView = GetEntryWidgetBlueprintView(EntryWidgetClass.Get()))
Is this a safe and proper fix for the issue?