Bug 159768 - Hypertext, relative URL to local files does not work
Summary: Hypertext, relative URL to local files does not work
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.7.2 release
Hardware: x86-64 (AMD64) Linux (All)
: high major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Hyperlink
  Show dependency treegraph
 
Reported: 2024-02-19 01:12 UTC by garrytre
Modified: 2024-05-30 16:17 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
process notes, comments, screen dumps (150.61 KB, application/vnd.oasis.opendocument.text)
2024-02-19 01:12 UTC, garrytre
Details

Note You need to log in before you can comment on or make changes to this bug.
Description garrytre 2024-02-19 01:12:39 UTC
Created attachment 192628 [details]
process notes, comments, screen dumps

I have a directory /lecture that contains a geology.odt.
I have subdirs /lecture/images    /lecture/videos    etc
I want to use hyperlinks to access eg the images.

I want to be able to put /lecture plus subdirs on a USB stick and move to another computer.

<read carefully, because this references another bug>
But the URL in the hyperlink not only looks the same, it is the same, and so the images are not accessible. (various forums say that even though it looks the same, internally it becomes relative)

Ideally I'd like something like ../images/pic.png, so that wherever the .odt was, it could access the files in the subdirs.
Comment 1 Stéphane Guillou (stragu) 2024-02-28 13:41:26 UTC
Thanks for the report.
Does the second installation of LibreOffice have the same setting in the Options dialog? That might be why the URL does not work.

There is an enhancement request in bug 111957 that would make this area more logical if implemented.

Please also refer to the help page: https://help.libreoffice.org/24.2/en-US/text/shared/optionen/01010200.html
Indeed, the tooltip always displays an absolute path (a change is requested in bug 128216)

Can you please:
- check the settings of the second installation of LibreOffice, to see if they match
- install a currently supported version of LibreOffice: 7.6 or 24.2 (bugs have been fixed since 7.3)
- if the issue is resolved, let us know if you'd be happy to have this marked as a duplicate of bug 111957
Comment 2 Eike Rathke 2024-05-29 10:48:05 UTC
The relative URI feature appears to be completely broken, see also https://ask.libreoffice.org/t/relative-path-changed-to-absolute-on-save/106291

Just create two spreadsheet files, in one (file1.ods) add a Ctrl+K hyperlink to the other (file2.ods), save, verify with Ctrl+Click it opens the second file (if not still opened), close both, move both documents to a different directory, open file1.ods, Ctrl+Click the hyperlink and see it wants to open file2.ods at the old absolute location. This in all versions from 24.8.0.0.alpha1+ and 24.2.4.0.0+ back to 7.4.7 (didn't try earliers).
Comment 3 Stéphane Guillou (stragu) 2024-05-29 14:09:29 UTC
(In reply to Eike Rathke from comment #2)
> The relative URI feature appears to be completely broken, see also
> https://ask.libreoffice.org/t/relative-path-changed-to-absolute-on-save/
> 106291
> 
> Just create two spreadsheet files, in one (file1.ods) add a Ctrl+K hyperlink
> to the other (file2.ods), save, verify with Ctrl+Click it opens the second
> file (if not still opened), close both, move both documents to a different
> directory, open file1.ods, Ctrl+Click the hyperlink and see it wants to open
> file2.ods at the old absolute location. This in all versions from
> 24.8.0.0.alpha1+ and 24.2.4.0.0+ back to 7.4.7 (didn't try earliers).
I can't reproduce that issue. I even tried it with saving file1.ods for the first time before vs after creating the hyperlink, as I didn't expect it to work in the after case. But it worked in both cases.

With "Save URLs relative to file system" tuned on, and:

Version: 24.2.3.2 (X86_64) / LibreOffice Community
Build ID: 433d9c2ded56988e8a90e6b2e771ee4e6a5ab2ba
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded

Do you have more details?
Comment 4 Eike Rathke 2024-05-30 16:17:11 UTC
Not really.. it seemed to work (once?) when both files were initially created in / saved to the (as per LO settings) My Documents path, but not in another directory. Then the absolute path was saved. Trying to reproduce it failed also with the My Documents path. Something strange going on.