Zim

Linking with Browse button creates incorrect file path

Bug #1704453 reported by Laecy
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Zim
New
Undecided
Unassigned

Bug Description

This does not create a bug report, but it worked in 0.66 and now does not work correctly in 0.67.

I keep all external files (primarily PDF's) in a single Media folder in my main Notes folder. It is not part of the Wiki link structure directly, but whenever I need to link to one of the files, I use the Browse button to navigate to it directly - this makes the external files easier to look through instead of seeking out individual attachment folders within each page.

While the Browse button leads to the same window, and I can find the Media folder and all its contents within the Link widget, it creates a faulty file path in the link.

The page at

  ToDo List
  ->Learning
  ->->Further Reading
  ->->->Books
  ->->->->From Religion to Philosophy
  ->->->->->Full Text

has a link named PDF that should navigate to

  C:\Users\Laecy\Desktop\Zim Desktop Wiki Portable\Notebooks\Notes\Media\From Religion to Philosophy.pdf

  (copied from File Explorer pathbar)

It creates the link

  ..\Media\From Religion to Philosophy.pdf

and clicking on it gives the message

  No such file or folder:
  C:\Users\Laecy\Desktop\Zim Desktop Wiki Portable\Notebooks\Notes\ToDo_List\Learning\Further_Reading\Books\Media\From Religion to Philosophy.pdf
  The file or folder you specified does not exist.
  Please check if you the path is correct. [sic]

If I manually paste the file path into the Edit Link widget, the same error results.

If I try to manually edit in more "..\"s, they are automatically deleted.

Links to PDFs created prior to the switch to 0.67 are unaffected and still pull up the PDF correctly.

If I copy "../../../../../../" from one of the working links and paste it into the broken link to create

  ../../../../../../Media\From Religion to Philosophy.pdf

it changes to

  ~\Notebooks\Media\From Religion to Philosophy.pdf

and clicking on it gives

  No such file or folder: C:\Users\Laecy\Desktop\Zim Desktop Wiki Portable\Notebooks\Media\From Religion to Philosophy.pdf
  The file or folder you specified does not exist.
  Please check if you the path is correct. [sic]

If I copy "../../../../../../Media/" from one of the working links and paste it into the broken link to create

  ../../../../../../Media/From Religion to Philosophy.pdf

it changes to

  ~\Notebooks\Media\From Religion to Philosophy.pdf

and clicking on it gives

  No such file or folder: C:\Users\Laecy\Desktop\Zim Desktop Wiki Portable\Notebooks\Media\From Religion to Philosophy.pdf
  The file or folder you specified does not exist.
  Please check if you the path is correct. [sic]

If I edit the Notes folder into the automatically generated link to create

  ~\Notebooks\Notes\Media\From Religion to Philosophy.pdf

it changes to

  ..\Media\From Religion to Philosophy.pdf

and clicking on it gives

  No such file or folder: C:\Users\Laecy\Desktop\Zim Desktop Wiki Portable\Notebooks\Notes\ToDo_List\Learning\Further_Reading\Books\Media\From Religion to Philosophy.pdf
  The file or folder you specified does not exist.
  Please check if you the path is correct. [sic]

If I change one of the working links at an analogous hierarchy level from

  ../../../../../../Media/Alvin Toffler - Future Shock.pdf

to

  ../../../../../../Media/From Religion to Philosophy.pdf

it changes to

  ..\Media\From Religion to Philosophy.pdf

and clicking it gives

  No such file or folder: C:\Users\Laecy\Desktop\Zim Desktop Wiki Portable\Notebooks\Notes\ToDo_List\Learning\Further_Reading\Books\Future_Shock\Media\From Religion to Philosophy.pdf
  The file or folder you specified does not exist.
  Please check if you the path is correct. [sic]

If I replace the formerly working link with its original file path

  ../../../../../../Media/Alvin Toffler - Future Shock.pdf

it changes to

  ..\Media\Alvin Toffler - Future Shock.pdf

and gives

  No such file or folder: C:\Users\Laecy\Desktop\Zim Desktop Wiki Portable\Notebooks\Notes\ToDo_List\Learning\Further_Reading\Books\Future_Shock\Media\Alvin Toffler - Future Shock.pdf
  The file or folder you specified does not exist.
  Please check if you the path is correct. [sic]

I am using the portable version for windows downloaded at https://zim.glump.net/site/assets/files/1084/zim-desktop-wiki-portable-0_67.exe

Thanks!!

Laecy (laecy)
description: updated
Revision history for this message
M F (apollo666-66) wrote :

I have similar behavior: the automatic path creation to a file does not work correctly. There is an issue with too few ".."
Example:
- I highlight some text in a page and want to link a file.
- In the "Edit Link"-window, I open "Browse" and browse to the file.
- Choosing the file via the button "Open" brings me back to the "Edit Link"-window.
- The automatically set path in "Link to:" is wrong if the link has to go up more than 1 hierarchy level: it places ONE AND ONLY ONE ".." to navigate out of the current folder. However, more ".."'s are necessary to navigate to the correct level.

Workaround (very annoying): correct the link to the absolute path.

Proposal for solution:
- Make sure that the correct number of ".." are placed in the link or discard relative navigation and use absolute paths.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.