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

File links generated while operating in "richworkspace"-mode are missing the base-directory of the editied 'Readme.md` #2164

Closed
rotdrop opened this issue Feb 7, 2022 · 2 comments
Labels
bug Something isn't working invalid

Comments

@rotdrop
Copy link

rotdrop commented Feb 7, 2022

Describe the bug
File links generated while operating in "richworkspace"-mode are missing the base-directory of the editied 'Readme.md`

To Reproduce
Steps to reproduce the behavior:

  1. enable "richtworkspace"-mode in the files app
  2. got to a sub-directory
  3. edit a Readme.md there
  4. link to a file using the "menu-bubble"
  5. click on the generated link
  6. land in Nirwana

Expected behavior
Open the linked file ;)

Screenshots
Well, just to demonstrate what this "richworkspace" means, it is the displayed Readme.md at the top of the folder-view of the files-app:
Screenshot_20220207_011705

Text app version: (see Nextcloud apps page)

Git-branch stable23. But the bug is also present in the master branch.

Explanation

When insert links to files with the "Menububble" we finally land here:

command({ href: `${encodedPath}?fileId=${fileInfo.id}` })

As it shows, the called command() finally ends in helpers/links.js

const currentDir = basedir(OCA.Viewer.file)
const dir = absolutePath(currentDir, basedir(relPath))
return generateUrl(`/apps/files/?dir=${dir}&openfile=${id}#relPath=${relPath}`)

There, OCA.Viewer.file is used to determine the basename of the file being edited (here the directory's Readme.md). However OCA.Viwer.file is empty we land here coming from the "richworkspace" mode.

I have submitted a pull-request #2163 to work around, however, its a little bit of a hack maybe.

@luka-nextcloud
Copy link
Contributor

@rotdrop
I am not sure what it means:
link to a file using the "menu-bubble"

@mejo-
Copy link
Member

mejo- commented Nov 1, 2022

@luka-nextcloud I guess that this issue got resolved by #3269. So #2163 probably can be closed as already implemented as well.

@mejo- mejo- closed this as completed Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants