-
Notifications
You must be signed in to change notification settings - Fork 535
Description
When viewing an unrestricted file in a published dataset, if a draft dataset exists, the preview tab does not display. And, if that is fixed, the previewer tries to load the draft dataset version and fails.
Digging in, it looks like there are two places where getLastestFilemetadata is getting called (directly or indirectly) and leading to these failures. In the FilePage, the init() method correctly picks the filemetadata for the requested version, but the preview() method was using file.getFileMetadata() which gets the draft version. (The second issue above).
In file.xhtml, there is a render check requiring the FilePage.filemetadata.datasetversion (e.g. 1.0) to be equal to the latestversion of the dataset (e.g. draft in this case).
I'll submit a PR with updates for both which work for me to make the preview tab show for this case. (Question - was the design to not allow prior versions to be previewed? I.e. is checking that the datasetversion is the latest public version what was intended?).