Resolve field instance models using index when filtering errors#4434
Merged
tdonohue merged 1 commit intoDSpace:mainfrom Jun 12, 2025
Merged
Resolve field instance models using index when filtering errors#4434tdonohue merged 1 commit intoDSpace:mainfrom
tdonohue merged 1 commit intoDSpace:mainfrom
Conversation
pcg-kk
approved these changes
Jun 11, 2025
Contributor
pcg-kk
left a comment
There was a problem hiding this comment.
Look fine for me - error not happen anymore
Member
|
@kshepherd : from looking at |
Member
Author
|
@tdonohue agreed! i added the label, thanks |
tdonohue
approved these changes
Jun 12, 2025
Member
tdonohue
left a comment
There was a problem hiding this comment.
👍 Code makes sense to me. Thanks @kshepherd !
Contributor
|
Successfully created backport PR for |
Contributor
|
Successfully created backport PR for |
Contributor
|
Successfully created backport PR for |
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 free
to 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.
Description
This is a very small change that fixes form error handling for repeated fields, by correctly passing the field index to
formBuilderService.findById()when resolving a parsed field to a dynamic form control model.Without this change applied, the error is always rendered for the first element only, and in some cases does not correctly invalidate or render an error message at all.
With this change applied, the correct field instance is made invalid and the message displayed.
This might not be noticeable to many DSpace configurations since most errors are "required" errors, where by definition a repeated field is usually not empty/null, but you can test this with a custom error message, or the regex submission config validator.
Instructions for Reviewers
To test:
submission-forms.xmlWithout this PR applied, the error will either not display or display only for index 0.
With this PR applied, the error should display properly in the correct field index.
Checklist
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lint