Bug 424340 - PDF bookmarks not found when opening document by symbolic link
Summary: PDF bookmarks not found when opening document by symbolic link
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 1.10.2
Platform: unspecified All
: NOR minor
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-17 16:18 UTC by Grzegorz Kowzan
Modified: 2020-08-09 16:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 1.12.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grzegorz Kowzan 2020-07-17 16:18:23 UTC
SUMMARY
Bookmarks for a PDF document not found when the document is opened through a symbolic link.

STEPS TO REPRODUCE
1. Create a folder ~/dir_x and a symbolic link to it at ~/dir_y.
2. Open file ~/dir_x/file.pdf and create a bookmark.
3. Open the same file through ~/dir_y/file.pdf path, bookmark is not found.

POSSIBLE SOLUTION
Resolve absolute path when opening a file or compare absolute paths when looking for bookmarks.
Comment 1 Bug Janitor Service 2020-07-22 23:30:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/224
Comment 2 Albert Astals Cid 2020-08-08 10:48:02 UTC
Git commit caa351c723c906cb2f675e298a17427928b7abd3 by Albert Astals Cid.
Committed on 07/08/2020 at 22:34.
Pushed by aacid into branch 'master'.

Bookmarks: Resolve symlinks before using an url

If a symlink points to another file, we should use that file as
canonical source for bookmarks, it doesn't make sense to have two
different sets of bookmarks for two paths that are essentially the same
file

M  +34   -14   core/bookmarkmanager.cpp
M  +14   -14   core/bookmarkmanager.h

https://invent.kde.org/graphics/okular/commit/caa351c723c906cb2f675e298a17427928b7abd3