Skip to content

Required field validation ignores scope when fields are hidden/readonly #520

@profjellybean

Description

@profjellybean

Describe the bug
In DSpace, when a metadata field has both a element and and/or elements, the submit form validation does not consider the defined scopes.
Currently, the backend enforces required validation even if the field is hidden or readonly in the current scope.

To Reproduce
Steps to reproduce the behavior:

  1. Configure a metadata field with and / in certain scopes.

  2. Submit an item in a scope where the field should be hidden or readonly.

  3. Observe that the backend still enforces required validation.

Expected behavior
Required validation should be ignored if the current scope matches or . The backend must check the scope before enforcing required fields.

Related work
PR: Scope-aware required field validation

  • Updated MetadataValidator to check scope before validating required fields.
  • Added logic to skip validation for hidden/readonly fields in the current scope.
  • Fixed/extended test cases for scope-aware validation.
  • Added test form definitions with proper scope declarations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions