-
Notifications
You must be signed in to change notification settings - Fork 493
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
dataverse_json with "metadataLanguage":"undefined" cannot be imported #8868
Comments
When the metadatalanguage value was switched from null meaning undefined to 'undefined' meaning undefined, the DDI export was changed to check that , e.g. dataverse/src/main/java/edu/harvard/iq/dataverse/export/ddi/DdiExportUtil.java Lines 166 to 171 in 751a008
|
This will impact exports. |
@landreev @qqmyers There isn't a util for the json exporter, so does it make sense to update the printer so that the metdataLanguage field is only added if it's something other than undefined or do we want/need it to be undefined for purposes other than export? In other words is this a possible solution (in the printer)?
` |
~yeah - I would suggest moving the Util method to some other class and calling it from both DDI and the json printer, but I don't know what ~Util class it should go in (just StringUtil? DvObjectContainer where UNDEFINED_METADATA_LANGUAGE_CODE is defined?). (It's not a very big method but the bug is because we/I had different code in two places.) |
This looks good. Once you make a PR I can review and/or QA it quickly. |
Ok. I was just rerunning the integration tests after getting the latest from Dev. |
Starting v5.7, it’s possible to define metadataLanguage for a dataset. This value also gets exported in dataverse_json. When it’s not defined,
"metadataLanguage":"undefined"
is exported.However, it appears that this “undefined” value is not accepted on import:
Specified metadatalanguage not allowed
.As an example: None of the datasets in our own prod. have the metadata language defined; and all the datasets have been re-exported since 5.7. So the impact of this is that none of our prod. dataverse_json exports are importable.
It appears that the code on the import side that's actually throwing the exception has only been added in 5.11; so that must be the reason nobody has noticed/complained yet:
The text was updated successfully, but these errors were encountered: