-
Notifications
You must be signed in to change notification settings - Fork 58
fix(viewer): address file path composition for subfolders in public shares #2980
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
Conversation
|
Also, can we backport this to the stable 30? I experienced this issue on 30.0.1. |
|
Hi @skjnldsv, |
ebbf638 to
bc8a650
Compare
|
Thank you! Can confirm that fix works for me.. |
…n subfolders in a file share. Previously, node.path for files ina a shaer were `/${file.basename}`
Fixes nextcloud#2977
Fixes nextcloud#2976
bc8a650 to
ab52cab
Compare
|
Hi @skjnldsv, I'm looking forward to the next major version of the Viewer app in development! As a stopgap, when do you think you or one of your colleagues might be able to review and backport this fix? |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Fix: Added the
dirPathto thenode.pathfor file comparisons in public shares, enabling the image viewer to function correctly when accessing images within subfolders. This resolves the issue where users could not navigate through images in subfolders when sharing the parent folder publicly.I couldn't get the alternative of using
fileidattribute for both working for whatever reason.Fixes #2977. Fixes #2976. Fixes #2990.
Description of bug:
In commit cce1e1d, a new sort was introduced that compared
node.pathtofile.filename. In a public file share, thenode.dirnameis evaluating to/even within a subfolder sonode.path(which seems to be${node.dirname}${node.basename}) is always/${node.basename}.However,
file.filenameisdirPath/displayname. Thus, if one attempts to scroll through in the top level of a public share,node.pathis the same asfile.filenamesincedirPathisnode.dirname, that is/. In a subfolder path, this isn't true. Since we are unable to change thepathfor the NcFile, I appended thedirPathduring the filter.Alternative fixes:
Alternatively, the better approach would be rectify the path variable for the NcFile but I didn't see a method to do that.
Testing
I tested this using the dev repo (https://github.com/juliusknorr/nextcloud-docker-dev) and copied all the files from
Mediainto a subfolder calledimagesand shared theMediafolder using a public link to get the following:Using Big_Buck_Bunny_1080_10s_10MB.mkv in
Media:Using Big_Buck_Bunny_1080_10s_10MB.mkv in
Media/images:tree .