-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix Discrepancy for publicationYear #303
Conversation
Visit the preview URL for this PR (updated for commit c0407e9): https://cioos-metadata-form--pr303-295-discrepancy-for-4eghpnip.web.app (expires Sat, 17 Feb 2024 01:09:31 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 57eda2a7622dc877ccadb675a0532261c52b09fd |
I guess this will only fix new records moving forward. Not already submitted data sets. |
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.
this appears to resolve the problem mentioned in the issues but it would be good if tim or nate could also review.
I'm getting an error "Error occurred with DOI API" when I select Update DOI. Also, within the Metadata Entry Tool, the publication year doesn't show up in the recommended citation anymore. |
@timvdstap I'm unable to reproduce your errors. Let's chat again when you're able to. |
We were able to reproduce the error, the revised date showed up correctly in DataCite when initially generating a draft DOI, only produced an error when trying to update an existing draft DOI. |
Thanks for catching this error, @timvdstap ! The error occurred because the Date picker returns a Date object when the user selects a new date. Firebase stores the date as a string. When clicking the save button, the Date object is updated to a date string. In Updated |
publicationYear seems to get updated now properly in DataCite, as well as in the recommended citation in the metadata form. I guess this only applies to newly created metadata records, so I'm not sure yet whether a 'Findable' record in DataCite will also get updated properly in DataCite. |
should we merge this now then? Or do we need to figure out the |
@sorochak You say that this will only impact new records moving forward, could you tell me why that is? The revision to the publicationYear will also be necessary for time series records that are currently published and are getting a new version. Or do you mean that existing versioned records do not automatically get their publicationYear updated? I'm hesitant to try the Findable component through the emulator because a lot of published records in there (such as e.g. the JSP Time Series record) are incomplete compared to their current versions in the Hakai Catalogue. Seems like the only way to test whether publicationYear also gets updated properly for Findable records would be to either a) create a new Findable DOI through the emulator (which we'll have to then set to Registered so it doesn't get indexed), or b) merge this PR and address any bugs that arise. |
My comment regarding that this change will only impact new records moving forward meant that existing versioned records do not automatically get their publicationYear updated. Those existing records would need to be updated manually for the publicationYear to change to the revision date. |
This PR fixes the discrepancy outlined in #295
Updated
recordToDataCite
mapping function to set publicationYear to dateRevised if it exists, otherwise use datePublished.Updated
generateCitation
function to check for dateRevised before datePublished.