Skip to content
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

files: fileid param leads to redirect that drops all other params #20818

Closed
azul opened this issue May 4, 2020 · 2 comments
Closed

files: fileid param leads to redirect that drops all other params #20818

azul opened this issue May 4, 2020 · 2 comments
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

Comments

@azul
Copy link
Contributor

azul commented May 4, 2020

If urls in the files app contain the fileid param they trigger a redirect that drops all other params:

http://nextcloud.local/index.php/apps/files/?dir=/Wiki&fileid=96&openfile=190
-> 303 redirect to
http://nextcloud.local/index.php/apps/files/?dir=/Wiki
-> url changed by javascript to
http://nextcloud.local/index.php/apps/files/?dir=/Wiki&fileid=96

First of all this is odd behaviour and i believe it was introduce to handle links like

/http://nextcloud.local/index.php/f/192

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 the fileid param opening it in a new tab will trigger a 303 redirect that drops the fileid and all other params.

This is currently not an issue because for the href in the link in the filelist the openfile param is added without thefileid by using this.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:

  • drop fileid param if it's there
  • add openfile param
  • leave other params as is.
    The removal of the fileid param is somewhat arbitrary. Instead it would be better if adding the openfile param to the current url was enough.
@azul azul added bug 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels May 4, 2020
@szaimen
Copy link
Contributor

szaimen commented Jun 2, 2021

Is this Issue still valid? If not, please close this issue. Thanks! :)

@ghost
Copy link

ghost commented Jul 2, 2021

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

@ghost ghost added the stale Ticket or PR with no recent activity label Jul 2, 2021
@ghost ghost closed this as completed Jul 16, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants