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
How does TextureRenderTarget2D get TArray<uint8> type data?
How do I set a material as a post-processing material?
Why does the REMOVE method of map container remove elements have memory leaks?
UMG RichText not appear image when packaged
What is the difference between Camera and CineCamera?
How to delete some elements correctly when deleting an array loop?
What controls of umg have mouse wheel events in UE4.27?
Why does UV setting float2(1,1) display incorrectly in the material's custom node?
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 |