Description

It is possible to re-use an existing key in a data table containing a TMap without triggering an error message. If the data table is saved with the duplicate key still present, the previous element using that key will be replaced when the project is closed and opened again.

Steps to Reproduce
  1. Download the attached project (created in Main stream, CL 3926545).
  2. Associate the project with your version of the Engine.
  3. Build the project in Visual Studio.
  4. Open the project in the Editor.
  5. Open the NewDataTable asset.
  6. Add a new element to each of the three existing TMaps in the data table.
  7. Set the value for each of the new elements to any value.
  8. Change the key for each new element to be the same as one of the existing elements in each TMap.
  9. Save the data table.
    • Note that there is no error about the key already existing.
  10. Close the Editor.
  11. Re-open the project in the Editor.
  12. Open the NewDataTable asset.

RESULT:
The new elements that were added to each of the existing TMaps have replaced the existing elements that previously used the keys the new elements were set to use.

EXPECTED:
Setting a new element to use a key that is already being used by another element would result in an error.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-55886 in the post.

4
Login to Vote

Won't Fix
ComponentTools
Affects Versions4.17.24.18.34.20
CreatedMar 7, 2018
ResolvedAug 18, 2021
UpdatedAug 18, 2021