Skip to content

Commit

Permalink
Fix to version check
Browse files Browse the repository at this point in the history
This is only used in determining the most recent version a dataset is in
on the file page, e.g. for https://demo.dataverse.org/file.xhtml
?persistentId=doi:10.70122/FK2/FO0MPQ/KNG6PA&version=3.0

I confirmed that demo shows version 1 in this example whereas it should
show version 2 (which this commit fixes).
  • Loading branch information
qqmyers committed Jun 12, 2024
1 parent 04580a3 commit c16fdd5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ public FileMetadata findMostRecentVersionFileIsIn(DataFile file) {
if (fileMetadatas == null || fileMetadatas.isEmpty()) {
return null;
} else {
return fileMetadatas.get(0);
// This assumes the order of filemetadatas is from first to most recent, which is true as of v6.3
return fileMetadatas.get(fileMetadatas.size() - 1);
}
}

Expand Down

0 comments on commit c16fdd5

Please sign in to comment.