We have discovered a rather unexpected behavior when editing a data table in the editor. If a row of the table is renamed the UDataTable::HandleDataTableChanged is not called. Upon investigation, I have noticed a slight difference between FDataTableEditorUtils::RenameRow and FDataTableEditorUtils::AddRow. In AddRow there is explicit notification DataTable->HandleDataTableChanged(RowName); Here is the screenshot of the code.
[Image Removed]
However in RenameRow there is no such notification. Once again see the attached screenshot.
[Image Removed]
Is there some reason for this inconsistency? I have added the missing notification into RenameRow and at first glance it seems to be working fine.
For context, I am trying to implement some automatic reaction to the modifications made to the data table in the editor and rebuild some custom data built on top of the data table. And using the OnDataTableChanged delegate in this data table seems like a nice convenient way.
Hello, just to provide more pieces of information. I have noticed that calling DataTable->HandleDataTableChanged(RowName); is quite inconsistent in DataTableEditorUtils. This called is present in FDataTableEditorUtils::AddRow but then it is missing not only in FDataTableEditorUtils::RenameRow but also in other functions like: FDataTableEditorUtils::DuplicateRow, FDataTableEditorUtils::AddRowAboveOrBelowSelection and FDataTableEditorUtils::RemoveRow.
HandleDataTableChanged was added via a github PR with https://github.com/EpicGames/UnrealEngine/pull/12213\. There is likely no reason for the inconsistency outside of organic development and reporting of issues over time.
There’s two options that could be taken (or both!):
Create a pull request with the desired change
Provide additional information on this ticket for the bug(s) you’re noticing caused by this inconsistency. This will help us verify the fixes are functioning as expected for the use cases.
The main observed behavior that is unexpected for me is when renaming a row in the data table the UDataTable::HandleDataTableChanged is not called and thus OnDataTableChanged notification is not broadcast. I wouldn’t say there is a bug per se, but the behavior is quite inconsistent.
We are building our custom functionality on top of the UDataTable in two layers
1. Object derived from UDataTable to create a table with custom functionality.
2. Object encompassing multiple derived data tables. External user interact with this object
We aim to automatically reflect any changes done to the tables - adding rows, renaming the rows, modifying values, etc. We have added a virtual modifier to UDataTable::HandleDataTableChanged. It is derived in our custom data table and allows us to make necessary operations to keep data consistent in the first layer, before broadcasting OnDataTableChanged. The second layer is connected to OnDataTableChange and it relies on data in the first layer being consistent.
Clearly there are workarounds to circumvent this behavior, but for me it makes sense to make the behavior when editing data tables more consistent.