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
Improve error handling for creating valkyrie collections #5604
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elrayle
force-pushed
the
val_col_create
branch
2 times, most recently
from
April 15, 2022 15:47
d0e4744
to
3b2a6dd
Compare
These tests fail before the fix is applied.
The approach is based on the same change that was made for works in [PR #5448](https://github.com/samvera/hyrax/pull/5448/files#diff-843d5f344066ba9de62a999cf88a87b29479b10988676c0bc474f4853e2adaf4).
cjcolvar
reviewed
Apr 18, 2022
cjcolvar
approved these changes
Apr 18, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
elrayle
added a commit
that referenced
this pull request
Apr 28, 2022
The approach is based on the same change that was made for works in [PR #5448](https://github.com/samvera/hyrax/pull/5448/files#diff-843d5f344066ba9de62a999cf88a87b29479b10988676c0bc474f4853e2adaf4) and for create valkyrie collections in (PR #5604)[https://github.com/samvera/hyrax/pull/5604/files].
elrayle
added a commit
that referenced
this pull request
Apr 28, 2022
The approach is based on the same change that was made for works in [PR #5448](https://github.com/samvera/hyrax/pull/5448/files#diff-843d5f344066ba9de62a999cf88a87b29479b10988676c0bc474f4853e2adaf4) and for create valkyrie collections in (PR #5604)[https://github.com/samvera/hyrax/pull/5604/files].
elrayle
added a commit
that referenced
this pull request
Apr 28, 2022
The approach is based on the same change that was made for works in [PR #5448](https://github.com/samvera/hyrax/pull/5448/files#diff-843d5f344066ba9de62a999cf88a87b29479b10988676c0bc474f4853e2adaf4) and for create valkyrie collections in (PR #5604)[https://github.com/samvera/hyrax/pull/5604/files].
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The new collection instance was being set to the results of the validation failure when it failed and to false when the transactions failed.
WAS:
Now, the form validation is processed before setting @collection. If a failure occurs, the process is aborted and calls after_create_errors. Likewise, if there is a failure during the transaction process, after_create_errors is called to process the error and redisplay the new form.
NOTE: This PR also moves after and before methods for create to private, deprecating the public versions. Again, this is consistent with the pattern used in works.
Follow-on work
Need to do the same for updates. This will be done in a separate PR to keep this one easier to review.
Related work
The approach is based on the same change that was made for works in PR #5448.
@samvera/hyrax-code-reviewers