dspace-angular icon indicating copy to clipboard operation
dspace-angular copied to clipboard

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

Open toniprieto opened this issue 1 year ago • 0 comments

References

  • Related to #2653

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

  • [x] 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.
  • [x] My PR passes ESLint validation using yarn lint
  • [x] My PR doesn't introduce circular dependencies (verified via yarn check-circ-deps)
  • [x] 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.
  • [x] 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.
  • [x] If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • [x] If my PR fixes an issue ticket, I've linked them together.

toniprieto avatar Apr 05 '24 14:04 toniprieto