When edited through the Details Panel in the Editor, TMap and TSet properties should not allow duplicate keys. When those keys are USTRUCTs with the “WithIdenticalViaEquality” trait, this should be ensured by comparing the keys with the struct’s == operator.
This does work in the check that does not allow a new item to be added when there is already one with the default key. But it does not work when setting fields in the key USTRUCT by typing in the details panel. In this case, it is possible to change the keys of several items to be the same. And this results in duplicate-key items being lost when saving and reloading the level, actor or other owner object.
This might seem like an unimportant corner case at first, but stepping through the code of the method FPropertyValueImpl::ImportText() on file PropertyHandleImple.cpp:244, it can be noted that the parent FProperty is seen there as a FStructProperty instead of the expected FMapProperty or FSetProperty (same thing on the check in line 442/448). So this might actually be revealing an important bug with other potential consequences elsewhere.
[Link Removed] of the context in which the bug is perceived when following the provided repro steps
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-194505 in the post.
4 |
Component | UE - Editor - Workflow Systems |
---|---|
Affects Versions | 5.2 |
Created | Sep 5, 2023 |
---|---|
Updated | Jan 19, 2024 |