fix dashboard/my/collections when default admin set table doesn’t exist #5328
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.
Description
A bug caused the missing table to be checked even after determining that saving the default admin set id wasn’t supported. It is supposed to be ok for the table to be missing for backward compatibility.
Solution
The primary cause of the bug was that a return was missing in the method that determines the default admin set id. It was supposed to return the
DEFAULT_ID
after determining that saving the id was not supported because the table was missing.Adding the return of the
DEFAULT_ID
when saving is not supported fixed the first problem and revealed a second problem where after not finding an admin set with theDEFAULT_ID
, it was throwing an exception. It is not ok for an admin set not to exist with the saved admin set id, but it is ok for an admin set with theDEFAULT_ID
not to exist. When this happens, the default admin set will be created withid=DEFAULT_ID
. This missing object exception is now ignored when theid==DEFAULT_ID
.@samvera/hyrax-code-reviewers