tldr; UListViewBase has “MustImplement = “/Script/UMG.UserListEntry”” as a UPROPERTY meta tag on EntryWidgetClass which means the property edit field in sub classes (eg. CommonListView) don’t always enforce the correct required interface check.
We’ve run into a situation where the “Use Selected Asset from Content Browser” can be used on the CommonListView to force an invalid asset to be used which can cause subtle bugs that can be tricky and time consuming to track down. This is partly an education issue on our behalf so developers know what they need to do to correctly use a CommonListView, but there is an editor bug that is allowing invalid workflows to “mostly work”.
CommonListView and ListView both require that widgets implement the UserObjectListEntry interface before they show as an option in the “Entry Widget Class” drop down. UListViewBase only requires widgets implement the UserListEntry interface. (The fact they are named so similarly was also a source of confusion for us, but not what I’m here to talk about)
* If the selected widget in the content browser doesn’t implement either interface then the “Use Selected Asset from Content Browser” button will not do anything -> Correct
* If the selected widget in the content browser implements UserObjectListEntry interface then the “Use Selected Asset from Content Browser” button will insert that widget as the selected entry -> Correct
* If the selected widget in the content browser implements UserListEntry interface then the “Use Selected Asset from Content Browser” button will insert that widget as the selected entry -> Wrong
This appears correct in some ways because the list will create the widget at both design time and game time, but other features won’t work. For example, if you enable the Viewmodel Extension it won’t correctly populate the list with the view models used by the selected widget causing confusion about why not.
I tried to track down the fix but I wasn’t able to get to the bottom of it, but got some ideas.
* PropertyHandleImpl.cpp -> FPropertyHandleObject::SetObjectValueFromSelection
This function checks for “GetClassMetaData(TEXT(“MustImplement”))” but it returns UserListEntry, not UserObjectListEntry. I believe this is because UListViewBase defines the member and sets the “MustImplement” meta tag to “/Script/UMG.UserListEntry” but then derived classes (eg. CommonListView) don’t report that the new interface to require is UserObjectListEntry.
I’m not sure how to resolve this at this point so I was hoping to pass this along and maybe someone knows off the top of their head how to resolve. This isn’t a major issue for us, but due to some knowledge gaps there have been some incorrect work patterns that have snuck in that we’re trying to get out and this bug caused those patterns to semi-legitimise themselves.
[Attachment Removed]