Skip to content
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

Deaccessioned dataset file edit fix. #10901

Merged
merged 10 commits into from
Oct 3, 2024
2 changes: 1 addition & 1 deletion src/main/java/edu/harvard/iq/dataverse/Dataset.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public DatasetVersion getLatestVersion() {

public DatasetVersion getLatestVersionForCopy() {
for (DatasetVersion testDsv : getVersions()) {
if (testDsv.isReleased() || testDsv.isArchived()) {
if (testDsv.isReleased() || testDsv.isArchived() || testDsv.isDeaccessioned()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it will fix the npe problem, but this method is used in many places and I'm not sure that all of them should include a deaccessioned version. For example -

for (FileMetadata fm : dataset.getLatestVersionForCopy().getFileMetadatas()) {
would export info about a deaccessioned version. We might need a separate getLatestPublicVersion method for such cases unless there's some other way to fix.

return testDsv;
}
}
Expand Down
Loading