Skip to content

Enforce non-repeatable fields in submission forms#10679

Closed
Wout-atmire wants to merge 1 commit intoDSpace:mainfrom
atmire:w2p-129946_enforce-non-repeatable-fields-in-submission-forms
Closed

Enforce non-repeatable fields in submission forms#10679
Wout-atmire wants to merge 1 commit intoDSpace:mainfrom
atmire:w2p-129946_enforce-non-repeatable-fields-in-submission-forms

Conversation

@Wout-atmire
Copy link
Contributor

@Wout-atmire Wout-atmire commented Apr 30, 2025

References

Description

Updated the Metadata validation to add an error when a non-repeatable visible input has multiple values.
To prevent imports from submitting items that have multiple values for non-repeatable input fields.

Instructions for Reviewers

List of changes in this PR:

  • Updated MetadataValidation#validate to add error (error.validation.not.repeatable) when a non-repeatable visible input has multiple values.

How to test:

  • Make dc.contributor.author non-repeatable in the traditionalpageone form (dspace/config/submission-forms.xml)
  • Login as a submitter
  • Navigate to /import-external
  • Search for 38940749 with Pubmed => Import Comparing Gold-Standard Sanger Sequencing with Two Next-Generation Sequencing Platforms of HIV-1 Single Genome Amplicons.
  • You should see multiple Authors even though the field isn't repeatable.
  • Upload a file and accept the license and click "Deposit"
    • This should fail.
    • In the POST server/api/submission/workspaceitems reques, verify that an error is returned:
    "message" : "error.validation.not.repeatable",
    "paths" : [ "/sections/traditionalpageone/dc.contributor.author" ]
    

Checklist

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & integration tests). Exceptions may be made if previously agreed upon.
  • My PR passes Checkstyle validation based on the Code Style Guide.
  • My PR includes Javadoc for all new (or modified) public methods and classes. It also includes Javadoc for large or complex private methods.
  • My PR passes all tests and includes new/updated Unit or Integration Tests based on the Code Testing Guide.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in any pom.xml), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR modifies REST API endpoints, I've opened a separate REST Contract PR related to this change.
  • If my PR includes new configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@Wout-atmire Wout-atmire moved this to 🙋 Needs Reviewers Assigned in DSpace 9.0 Release Apr 30, 2025
@alexandrevryghem alexandrevryghem changed the title 129946: Enforce non-repeatable fields in submission forms Enforce non-repeatable fields in submission forms Apr 30, 2025
@alexandrevryghem alexandrevryghem added bug 1 APPROVAL pull request only requires a single approval to merge. tools: import-sources Related to "Live Import" Sources feature, allowing import of content via external APIs. labels Apr 30, 2025
@tdonohue tdonohue added the component: submission Related to configurable submission system label Apr 30, 2025
@tdonohue tdonohue moved this to 🙋 Needs Reviewers Assigned in DSpace 10.0 Release May 19, 2025
@kshepherd
Copy link
Member

The scope checking here

if ((!input.isRepeatable() && mdv.size() > 1) && input.isVisible(DCInput.SUBMISSION_SCOPE)

does mean that it wouldn't validate during workflow scope, but.. that applies to other checks like "is required" as well, so I was going to ask if we could extend this check but now I think that might be better as a separate PR, I'll open something later.

@tdonohue tdonohue requested a review from atarix83 October 30, 2025 15:58
@tdonohue tdonohue moved this from 🙋 Needs Reviewers Assigned to 👀 Under Review in DSpace 10.0 Release Oct 30, 2025
@github-actions github-actions bot added the merge conflict PR has a merge conflict that needs resolution label Feb 5, 2026
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

Hi @Wout-atmire,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@tdonohue
Copy link
Member

This PR overlaps with the DSpace-CRIS feature being merged in #11964 / DSpace/dspace-angular#5145 as noted in DSpace/dspace-angular#4274 (comment).

Therefore, I'm going to close this PR as this fix will be coming in during the DSpace-CRIS merger. Thanks @Wout-atmire for your contributions to DSpace. If we find this fix has not been fully achieved during the DSpace-CRIS merger, we can always reopen/revisit this PR at a later date.

@tdonohue tdonohue closed this Feb 24, 2026
@github-project-automation github-project-automation bot moved this from 👀 Under Review to ✅ Done in DSpace 10.0 Release Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge. bug component: submission Related to configurable submission system merge conflict PR has a merge conflict that needs resolution tools: import-sources Related to "Live Import" Sources feature, allowing import of content via external APIs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Metadata import from external sources: Import allows multiple values for fields defined as non-repeatable in submission forms

4 participants