-
Notifications
You must be signed in to change notification settings - Fork 494
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
File Previews don't show in page if a draft version exists #6419
Comments
@qqmyers sounds find to me but just a heads up that we went back and forth with this notion of having the Preview tab with non-public files or not in pull request #6325 . See c35268b and 29a7edc especially and #6325 (comment) |
@pdurbin - this is not about showing non-public files. The presence of a draft version makes the published version un-previewable. |
Oh dear. Yes, a pull request would be much appreciated! 🎉 |
@pdurbin - do you know the answer to my question above? I think the version test in file.xhtml (after my fix for the draft issue) will still stop you from previewing a file in v1.0 if a later published version exists (e.g. v2.0). |
@qqmyers sorry, I don't know. And I forget what At a high level, my understanding is that for the Preview tab we are reusing some logic from when we show "Download URL" like this (no guestbook, no restrictions, etc.): But I could be off or the thinking could have changed. I'm not sure. So I should probably stop making noise in here. 😄 |
getLatestedVersionForCopy just returns the latest version that is released or archived, so it doesn't pick up a draft version. |
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?).
The text was updated successfully, but these errors were encountered: