Skip to content

Conversation

@profjellybean
Copy link

@profjellybean profjellybean commented Sep 11, 2025

Ensure required field validation respects scope restrictions.

  • Updated MetadataValidator to check current scope before enforcing required fields
  • Skipped validation for fields marked hidden/readonly in the active scope
  • Adjusted and added tests for scope-aware validation behavior
  • Added test form definitions with scope declarations

References

Add references/links to any related issues or PRs. These may include:

Description

Fix required field validation to respect scope restrictions. Validation now ignores required checks when the field is hidden or readonly in the current scope.

Instructions for Reviewers

This PR ensures metadata validation aligns with submission workflows by considering scope.

List of changes in this PR:

  • Updated MetadataValidator to check scope before validating required fields
  • Skipped validation for fields marked hidden/readonly in the active scope
  • Adjusted existing tests to cover scope-aware validation
  • Added new test form definitions with scope declarations

Include guidance for how to test or review your PR. This may include: steps to reproduce a bug, screenshots or description of a new feature, or reasons behind specific changes.

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • 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.
  • 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.

Ensure required field validation respects scope restrictions.
- Updated MetadataValidator to check current scope before enforcing required fields
- Skipped validation for fields marked hidden/readonly in the active scope
- Adjusted and added tests for scope-aware validation behavior
- Added test form definitions with scope declarations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Required field validation ignores scope when fields are hidden/readonly

1 participant