Skip to content

[DURACOM-326] fix possible issue on missing value for eperson patch #4289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FrancescoMolinaro
Copy link
Contributor

References

Fixes #4287

Description

Improve patch for EPerson to allow "add" operation.

Instructions for Reviewers

Inserted "add" operation as possible for EPerson modification.
Implemented test to ensure presence of "add" operation, created mock.

To reproduce the bug the easiest way is to delete one of the metadata on the DB, e.g. lastname, for an EPerson, and then try to add that metadata via UI. (Step by step at #4287).

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

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

@tdonohue tdonohue added bug authorization related to authorization, permissions or groups 1 APPROVAL pull request only requires a single approval to merge labels May 2, 2025
@tdonohue tdonohue moved this to 🙋 Needs Reviewers Assigned in DSpace 9.0 Release May 2, 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.

@FrancescoMolinaro : Thanks for this PR. I gave this a test today, and it nearly works, but it appears the EPerson changes are no longer saving.

Here's what I've tried with this PR in place.

  1. First, I'm running in production mode (npm run build:prod; npm run serve:ssr)
  2. Go in the Database, and delete the Last Name of a specific EPerson.
  3. Now, login as an Admin from the UI
  4. Find that EPerson account in the "Access Control" -> "People" area. Verify that it has no Last Name
  5. Now, edit that EPerson. Add a new Last Name. Click "Save". A confirmation of the new name appears (no errors occur).
  6. Find that EPerson again. It still has no Last Name.
  7. Refresh the page, It still has no Last Name.
  8. Check in the database, and it still has no Last Name in the database either.

Is there something missing from this PR on the backend? It appears to me that the adding a new value to an EPerson isn't working properly.

@github-project-automation github-project-automation bot moved this from 🙋 Needs Reviewers Assigned to 👀 Under Review in DSpace 9.0 Release May 2, 2025
@FrancescoMolinaro
Copy link
Contributor Author

Hi @tdonohue, thanks for the feedback, I tried again following the same steps you did but unfortunately I can't replicate the issue and I can see the the metadata in the DB and in the UI once added.
In my testing environment I am using the main branch for the rest without any modification to the code, may I please ask you to check the network request made once the form is saved?
We should have an "add" operation sent to the backend; the behavior described from your testing seems to be the same we had before the fix, were a "replace" operation was sent for a missing metadata, therefore failing to update the EPerson even though a success message was displayed.

I will be looking forward to your feedback.

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 authorization related to authorization, permissions or groups bug
Projects
Status: 👀 Under Review
Development

Successfully merging this pull request may close these issues.

Can't update EPerson information if metadata is completely missing
2 participants