Skip to content
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

Error loading the initial value when editing an authority field in edit item page #2900

Merged
merged 1 commit into from
May 9, 2024

Conversation

toniprieto
Copy link
Contributor

References

Description

While testing the functionality introduced by #2653 to edit authority-controlled values in the current main branch, I have observed that it is failing to load the initial values of the authority field because the model parameter used by these fields are not properly initialized. This PR changes how this model parameter is created to ensure its existence when the field is initialized.

Instructions for Reviewers

To reproduce the bug, edit an existing authority-controlled field value in edit item page, such as 'dc.type', 'dc.subject', or 'dc.contributor.author'. The field should load the initial value, but it remains empty, and the console shows the following error: ERROR TypeError: this.model is null

image

Checklist

  • 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 yarn lint
  • My PR doesn't introduce circular dependencies (verified via yarn 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.
  • 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 1 APPROVAL pull request only requires a single approval to merge component: authority control Related to internal authority control system labels Apr 5, 2024
@tdonohue tdonohue self-requested a review May 9, 2024 14:56
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 @toniprieto ! I've verified the bug still exists on main and that this PR fixes it.

@tdonohue tdonohue added this to the 8.0 milestone May 9, 2024
@tdonohue tdonohue merged commit 6da5c11 into DSpace:main May 9, 2024
10 of 11 checks passed
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: authority control Related to internal authority control system
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants