Skip to content

Conversation

@alexandrevryghem
Copy link
Member

References

Description

Fixed a validation issue that prevents you from submitting unqualified metadata fields, if the unqualified metadata field was added to the registry when 20 qualified fields with the same schema & element were already present in the DB

image

Instructions for Reviewers

List of changes in this PR:

  • Updated the MetadataFieldSelectorComponent to sort the field names during the validate() call. This ensures that the unqualified field is always present on the first page. I also reused the other pageOptions as well, this way if you type out the whole metadata field name correctly, the validate call won't send out an additional network request

Guidance for how to test or review this PR: See #4339

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 & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • 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 package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

…playing an error message

This only happens when the request that validates the metadata field doesn't return the field with qualifier null on the first page
@alexandrevryghem alexandrevryghem self-assigned this May 15, 2025
@alexandrevryghem alexandrevryghem added bug component: Item (Archived) Item display or editing labels May 15, 2025
@tdonohue tdonohue moved this to 🙋 Needs Reviewers Assigned in DSpace 9.0 Release May 15, 2025
Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks @alexandrevryghem ! Code makes sense. I gave this a test to also verify no accidental changes in current behavior, and I don't see any.

I also noticed this same code exists back to 7.x, so flagging this for backport to 8.x and 7.x

@github-project-automation github-project-automation bot moved this from 🙋 Needs Reviewers Assigned to 👍 Reviewer Approved in DSpace 9.0 Release May 15, 2025
@tdonohue tdonohue added port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release labels May 15, 2025
@tdonohue tdonohue merged commit be3dbd6 into DSpace:main May 15, 2025
15 checks passed
@github-project-automation github-project-automation bot moved this from 👍 Reviewer Approved to ✅ Done in DSpace 9.0 Release May 15, 2025
@dspace-bot
Copy link
Contributor

Backport failed for dspace-7_x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin dspace-7_x
git worktree add -d .worktree/backport-4340-to-dspace-7_x origin/dspace-7_x
cd .worktree/backport-4340-to-dspace-7_x
git switch --create backport-4340-to-dspace-7_x
git cherry-pick -x da6ace18827153ef247e0e4e1bbb2d09c46edc95

@dspace-bot
Copy link
Contributor

Backport failed for dspace-8_x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin dspace-8_x
git worktree add -d .worktree/backport-4340-to-dspace-8_x origin/dspace-8_x
cd .worktree/backport-4340-to-dspace-8_x
git switch --create backport-4340-to-dspace-8_x
git cherry-pick -x da6ace18827153ef247e0e4e1bbb2d09c46edc95

@tdonohue
Copy link
Member

@alexandrevryghem : the automated backports failed. If you wanted to backport this, it looks like this same code exists in 7.x/8.x. But, if you don't have time, we can just mark this as fixed in 9.0 (since it seems less likely for many sites to encounter)

@tdonohue tdonohue added this to the 9.0 milestone May 20, 2025
@alexandrevryghem alexandrevryghem deleted the w2p-130424_impossible-to-add-new-values-for-fields-without-qualifiers_contribute-main branch May 26, 2025 11:24
@alexandrevryghem alexandrevryghem removed port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release labels May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug component: Item (Archived) Item display or editing

Projects

No open projects
Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Impossible to add new unqualified metadata fields in edit metadata tab

3 participants