Error loading the initial value when editing an authority field in edit item page #2900
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Checklist
yarn lint
yarn check-circ-deps
)package.json
), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.