Description

UBlueprint::IsDataValid() does not currently check component templates inherited from a parent Blueprint class asset's SimpleConstructionScript; only the current class hierarchy is considered. Given that child Blueprint classes can override values on the inherited component template, this can lead to undetected data validation failures when compiling a child Blueprint.

Originally reported by user 'argingras' at https://github.com/EpicGames/UnrealEngine/pull/9437. The proposed PR walks the hierarchy to perform data validation, but we should instead do this directly through the InheritableComponentHandler instance that's attached to the Blueprint class.

Steps to Reproduce
  1. Create a new C++ project.
  2. Add a new BlueprintType ActorComponent subclass in C++.
  3. Add an editable int32 property to expose for editing.
  4. Override its IsDataValid() method to return false if the int32 value is greater than 10.
  5. Recompile the project and launch the editor.
  6. Create and open a new Actor-based Blueprint class (BP_Base).
  7. Add a new component of the above type.
  8. Compile, save and note that there are no errors.
  9. Highlight the component that was added and change the exposed int32 value to 20.
  10. Compile, save and note that data validation now fails.
  11. Reset the value back to zero, compile, save and close the Blueprint editor.
  12. Right-click on BP_Base and choose "Create Child Blueprint Class" - name it BP_Child.
  13. Open it in the Blueprint editor.
  14. Compile, save and note that there are no errors.
  15. Highlight the inherited component and change the exposed int32 value to 20.
  16. Compile, save and note that there are still no errors.
    Expected result: Data validation should fail on save, as it does when editing the component within the base Blueprint class asset.
Callstack

N/A

Have Comments or More Details?

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

0
Login to Vote

Fixed
ComponentUE - Gameplay - Blueprint
Affects Versions4.275.0
Target Fix5.1
Fix Commit21902209
Main Commit21910463
Release Commit21902209
CreatedSep 8, 2022
ResolvedSep 8, 2022
UpdatedSep 14, 2022
View Jira Issue