Publications without doi - #338
Merged
Merged
Conversation
Modeling and validations for DOI-less publications. Also, rough initial UI (only for curators) to register DOI-less publications
Hide the bulky publication form by default, and allow for autocomplete when possible
Member
Author
|
@vangberg Can you please take a look at this? I'm fairly certain it works well, but I appreciate a second pair of eyes on it. Thanks! |
To match the bounded form in the incertae sedis branch
vangberg
reviewed
Sep 7, 2026
| @publication = Publication.by_doi(params['publication']['doi']) | ||
| if @publication.new_record? | ||
| render('new') | ||
| if params['publication']['doi'].blank? && current_user.try(:curator?) |
Contributor
There was a problem hiding this comment.
In Rails 8 we could have used except_on[1] in a validation to create a specific context skipping the doi validation, but I can't think of a nicer way to do it now, so I think this is fine.
vangberg
reviewed
Sep 7, 2026
vangberg
approved these changes
Sep 7, 2026
vangberg
left a comment
Contributor
There was a problem hiding this comment.
Looks good.
Only concern is if we should do something to avoid duplicates now that we don't have the DOI as unique key?
vangberg
reviewed
Sep 7, 2026
Wraps DOI-less publication creation in a single transaction so author failures revert the entire change
This file contains hidden or 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
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.
DOI-less publications are rare but might be needed for some old references. This is very relevant now that we will need to register paratypes.