skip premature validation of required drop downs in metadata blocks #10125
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.
…mandatory
What this PR does / why we need it:
It skips a premature validation phase for a metadata block field with a mandatory drop down. This allows proper template change for a blank dataset and gives clearer error messages when saving.
Which issue(s) this PR closes:
Closes #10119
Special notes for your reviewer:
The HTML attribute
required
triggers a premature validation in metadata blocks. The db-tabledatasetfieldtype
controls the desired validation phase.Suggestions on how to test this:
Have a required field in a metadatablock (e.g. type of article in the journal block) and a custom template that should set a field(s) in the citation block (e.g. title). Create a new dataset, set none of the fields and change to the custom template, the title should be applied. Save the blank dataset and a clear error message appears for the type of article.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
no
Is there a release notes update needed for this change?:
no
Additional documentation: