files: fileid param leads to redirect that drops all other params #20818
Labels
0. Needs triage
Pending check for reproducibility or if it fits our roadmap
bug
needs info
stale
Ticket or PR with no recent activity
If urls in the files app contain the
fileid
param they trigger a redirect that drops all other params:First of all this is odd behaviour and i believe it was introduce to handle links like
However it's applied to all urls that have a
fileid
param.I ran into this because NC 19 introduces the
openfile
param in the files application that will trigger the viewer for the given file ( #20185 ). However if the url also contains thefileid
param opening it in a new tab will trigger a 303 redirect that drops thefileid
and all other params.This is currently not an issue because for the
href
in the link in the filelist theopenfile
param is added without thefileid
by usingthis.linkTo(path)
( https://github.com/nextcloud/server/pull/20185/files#diff-dafefd9519924bec4efa9f5af4af8e68R2175 ).However the link triggers js rather than a page load. So the url stays the same for now. I'm working on adding a function to the viewer app that updates the url / adds it to the history ( nextcloud/viewer#488 ).
The Viewer app is general purpose and can be used in other contexts. Currently the logic for getting the url after loading the viewer is:
fileid
param if it's thereopenfile
paramThe removal of the
fileid
param is somewhat arbitrary. Instead it would be better if adding the openfile param to the current url was enough.The text was updated successfully, but these errors were encountered: