Skip to content

Fix #2197 authority key lookup#2198

Merged
tdonohue merged 2 commits intoDSpace:mainfrom
uofmsean:fix-2197-authority-key-lookup
May 16, 2023
Merged

Fix #2197 authority key lookup#2198
tdonohue merged 2 commits intoDSpace:mainfrom
uofmsean:fix-2197-authority-key-lookup

Conversation

@uofmsean
Copy link
Copy Markdown
Contributor

Avoid an authority key lookup in DsDynamicVocabularyComponent when it starts with "will be generated::"

References

Fixes #2197

Description

During initialization for DsDynamicVocabularyComponent, avoid an authority key lookup when it starts with "will be generated::".

Instructions for Reviewers

List of changes in this PR:

  • Added FormFieldMetadataValueObject.hasAuthorityToGenerate() method to check if the authority key still needs to be generated
  • In DsDynamicVocabularyComponent.getInitValueFromModel(), skip the Solr authority lookup if the key still needs to be generated. This lets the logic fall through to the default else that creates initValue$ from the existing FormFieldMetadataValueObject

When ORCID authority is enabled, you can now lookup an author, save the submission for later, and when you reopen the submission, the correct author value (last name and first name) should be shown, and there will no longer be a Solr exception with the "will be generated::" lookup. Note that a complete fix for the Solr lookup exceptions requires DSpace/DSpace#8490 to be resolved as well.

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

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

uofmsean and others added 2 commits April 19, 2023 16:44
Avoid an authority key lookup when it starts with "will be generated::"
@tdonohue tdonohue added bug 1 APPROVAL pull request only requires a single approval to merge labels Apr 20, 2023
@tdonohue tdonohue added this to the 7.6 milestone Apr 20, 2023
@tdonohue tdonohue added the component: authority control Related to internal authority control system label Apr 20, 2023
@tdonohue tdonohue self-requested a review April 20, 2023 14:29
@tdonohue tdonohue requested a review from LucaGiamminonni May 1, 2023 18:56
@tdonohue tdonohue added identifiers: ORCID integration: ORCID Related to integration with ORCID identifier system labels May 1, 2023
Copy link
Copy Markdown
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 @uofmsean ! Verified this fixes the reported bug when ORCID Authority is enabled https://wiki.lyrasis.org/display/DSDOC7x/ORCID+Authority Submission form appears to work properly now and no errors on backend.

@tdonohue tdonohue merged commit e2c5171 into DSpace:main May 16, 2023
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 identifiers: ORCID integration: ORCID Related to integration with ORCID identifier system

Projects

No open projects
Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Solr lookup issues related to new authority keys with "will be generated::" syntax

2 participants