Uh oh!
There was an error while loading. Please reload this page.
[4.x] Add validation to prevent duplicate field handles - #9337
Merged
Conversation
jasonvarga
commented
Mar 7, 2024
Member
We already have validation on the blueprint level: Lines 613 to 622 in ec3c2a4 But, at some point I guess something changed and it doesn't work quite right. It looks like by the time it gets to line 619, the duplicates are already gone, so the exception doesn't get thrown. (Line 615 changed as part of #7746. It was probably that.) Regardless, even if it worked, the validation error only happens when you save the entire blueprint. This PR is a nice addition because it'll prevent you from putting a duplicate into the field stack in the first place. 👍 |
jasonvarga
approved these changes
Mar 7, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request implements a validation rule to prevent adding multiple fields to a blueprint with the same handle.
Previous to this PR, blueprints & fieldsets behaved differently to duplicate field handles:
Now, with this PR, when you attempt to save or update a field using the same handle as another field, you'll see a validation error:
The validation will check both actual fields in the blueprint as well as any fields imported via fieldsets.
Closes#9333.