Bug Hunting Session
Bug 118594 - impossible to specify relative file link including URI's like file: or run:
Summary: impossible to specify relative file link including URI's like file: or run:
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
6.0.5.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-06 20:28 UTC by muso
Modified: 2018-07-26 10:14 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
original input to create a relative file link (71.17 KB, image/jpeg)
2018-07-06 20:28 UTC, muso
Details
impress's error message that the path is an URL link, despite I created a file link (20.42 KB, image/jpeg)
2018-07-06 20:29 UTC, muso
Details
hyperlink dialog after opening the created hyperlink (61.71 KB, image/jpeg)
2018-07-06 20:31 UTC, muso
Details
PDF file with two relative file links (7.60 KB, application/pdf)
2018-07-23 23:52 UTC, muso
Details
a test ODG file (15.46 KB, application/vnd.oasis.opendocument.presentation)
2018-07-25 16:37 UTC, muso
Details
The LO hyperlink dialog (80.60 KB, image/jpeg)
2018-07-25 16:39 UTC, muso
Details
Acrobat file execution dialog (40.93 KB, image/jpeg)
2018-07-25 16:39 UTC, muso
Details
ExampleWithRelativeLink (449.77 KB, application/x-zip-compressed)
2018-07-25 20:07 UTC, Regina Henschel
Details
presentation and generated PDF (530.52 KB, application/x-zip-compressed)
2018-07-26 07:37 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description muso 2018-07-06 20:28:31 UTC
Created attachment 143368 [details]
original input to create a relative file link

- insert some text, highlight it and use the hyperlink toolbar button
- in the appearing dialog choose "Document"
- as I want to insert a relative link to a file that is in the same folder than my OPD file, I enter as Path:
Projekt SmARPro.mp4
because this is the filename. Attached is the screenshot of the dialog.

- now apply the setting and try to open the link

result: LO tells me that it is an invalid absolute link.

- therefore open the created hyperlink

result: LO transformed my file link to a URL link, see the attached screenshot
Comment 1 muso 2018-07-06 20:29:27 UTC
Created attachment 143369 [details]
impress's error message that the path is an URL link, despite I created a file link
Comment 2 muso 2018-07-06 20:31:01 UTC
Created attachment 143370 [details]
hyperlink dialog after opening the created hyperlink

So Impress transformed my file link to an URL link
Comment 3 Timur 2018-07-11 14:26:21 UTC
File path is URL. Issue here is whether relative file link is possible. 
I think it's not because file path is an argument for external application. 
So, in my view this is WONTFIX.
Comment 4 muso 2018-07-18 11:35:25 UTC
> File path is URL. Issue here is whether relative file link is possible. 
> I think it's not because file path is an argument for external application. 
> So, in my view this is WONTFIX.

I don't understand. For mail addresses there is the prefix "mailto:", for files there is "file:":
https://en.wikipedia.org/wiki/File_URI_scheme

So it must be possible to insert a relative file hyperlink with the file: prefix. I mean LO should allow what the official URI definition allows.

(I stumbled over this issue because I wanted to input a video link to my presentation. Unfortunately the video codec is not supported by LO. Therefore the idea was to insert a relative file hyperlink. This will trigger the default video program on the PC where I run my presentation.)
Comment 5 Timur 2018-07-18 12:21:15 UTC
You cannot confirm this yourself. Please wait. 
I expressed my opinion but I'm not sure hence I didn't change the status. 
It would be better if we could have relative link but I don't know if possible.
Comment 6 Heiko Tietze 2018-07-20 08:03:25 UTC
needsUXEval requires CC libreoffice-ux-advise@...
Comment 7 Jean-Baptiste Faure 2018-07-20 16:47:56 UTC
What did you set in Tools > Options > Load/Save > General about Save URL?

Status set to NEEDINFO, please set it back to UNCONFIRMED once requested
informations are provided.

Best regards. JBF
Comment 8 Timur 2018-07-23 13:06:19 UTC
I have default setting with checked "Save URLs relative to file system".
There's help https://help.libreoffice.org/6.2/en-US/text/shared/optionen/01010200.html that indicates relative addressing is possible. 
But I can't get it to work. 

So it looks like there's a bug here, either to make it work or change the documetnation.
Comment 9 muso 2018-07-23 18:54:18 UTC
> What did you set in Tools > Options > Load/Save > General about Save URL?

I have default setting with checked "Save URLs relative to file system".
Comment 10 Regina Henschel 2018-07-23 21:10:56 UTC
"Document" in the hyperlink dialog means, that the target of the Hyperlink is e.g. a bookmark inside a text document or a slide inside a presentation. With the field 'Path' you select the document and with the field 'Target' you select the target inside the document.

You should never insert something manually into these fields, but use the button at the right side of the input field. LibreOffice will automatically generate a suitable syntax. This is especially important, if the path has spaces or special characters.

Are you sure, that LibreOffice can play the video? Use Impress and Tools>MediaPlayer to test it.

The expected way to link to a Media is to use the MediaPlayer. Open the file in the MediaPlayer and then click on the "Apply" button, that will add a dummy shape for the media. In edit mode you find 'Media Playback' in the sidebar, when you have selected the dummy shape; in presentation mode it will play automatically, when the slide is shown (that implies one media per slide).  

Or alternatively, for Audio you can use an Interaction "Play Audio" on a shape. For Video you can use an Interaction "Run program" to start a separate application.

On Windows the links are relative as default, as long as the place of the document and the link target are on the same drive, even if in a dialog the link is shown as absolute. So no need to worry about it. If you have document and media file in the same folder, you can test it easily: Close document, rename the folder, open the document and the links should still work.
Comment 11 Regina Henschel 2018-07-23 22:03:24 UTC
In case your video is not supported, you might need to install a codec, see https://wiki.documentfoundation.org/Media_Support/Windows
Comment 12 muso 2018-07-23 23:47:53 UTC
> Are you sure, that LibreOffice can play the video? Use Impress and
> Tools>MediaPlayer to test it.

This works, but not with my particular video file. I know that LO needs a suitable codec for this. However, this is not the bug I reported here.

The bug is that LO doesn't allow me to insert a relative file link. I have special files I need to open from within my presentation. E.g. I use a special math CAS program. I need to click on the link to the relative path to my CAS file to open it with the program defined in the PC settings to open that file type.

With LaTeX such a link is easy to create - either use the "file:" prefix or the "run:" prefix to assure that the linked file is executed not only opened. I attached an example PDF showing that this works. Thus the PDF format understands all URI's:
https://en.wikipedia.org/wiki/URI_scheme
but LO doesn't allow the user to use them. LO only supports "http(s):" and "mailto:"

I don't see a reason why LO doesn't allow the usage of the other defined URI's.
Comment 13 muso 2018-07-23 23:52:11 UTC
Created attachment 143722 [details]
PDF file with two relative file links

The PDF file contains 2 relative file links, one with the URI file: one with the URI run:. To see that they work, rename an existing mp4 file to
"Projekt SmARPro.mp4"
and put the PDF to its file folder. On clicking the run: link the MP4 file will be played using the default mp4-player program of your PC.
Comment 14 Regina Henschel 2018-07-24 07:21:21 UTC
I obviously wasn't clear enough. Let me therefore reiterate the crucial points:
Do not manually enter anything into the Path field in the Hyperlink dialog, but use the button on the right side to select the file. The result will look like an absolute path, but LibreOffice actually writes a relative path to the file, when you save the presentation.
Comment 15 Heiko Tietze 2018-07-24 09:49:22 UTC
(In reply to Regina Henschel from comment #14)
> Do not manually enter anything into the Path field in the Hyperlink dialog,
> but use the button on the right side to select the file. ...

Is there any reason to keep the fields editable? There might be a simple read-only switch that solves this issue.
Comment 16 muso 2018-07-25 15:27:36 UTC
(In reply to Regina Henschel from comment #14)
> I obviously wasn't clear enough.
Seems that I was not clear enough. What I need but what LO doesn't allow me is to link to a file in general. For example I need to set a link to the file "test.mno" which is in the same folder than my .odg file. During hte presentation I need to click on that file link and the program that is connected in the Windows registry to open .mno files will open my test.mno file.
To achieve this, I need in this form
file:test.mno
or
run:test.mno

The problem is that Lo doesn't offer me any method to set the URI "file." or "run:"
Comment 17 Regina Henschel 2018-07-25 15:49:13 UTC
You do not need "file:" or "run:" in case Windows has registered an application to open .mno files. A simple hyperlink of type "Document" to the file will work. Please try it.
[BTW: The slideshow setting "Presentation always on top" has to be off. Otherwise you cannot work in that app.]
Comment 18 muso 2018-07-25 16:35:49 UTC
(In reply to Regina Henschel from comment #17)
> You do not need "file:" or "run:" in case Windows has registered an
> application to open .mno files. A simple hyperlink of type "Document" to the
> file will work. Please try it.

Thanks for your patience with me. However that is the bug. This doesn't work because:
- the link is always absolute
- the link contains then always the URI "file:"

I need:
- relative links to files to assure that they will be opened also on other PCs.
- a possibility to decide which URI should be used and full access to all defined URIs.

I attached now again an odg file to show you the problem. can't you see the problem? Also after exporting the odg to PDF you can see that the link created by LO is an absolute path.
(I always use PDFs when presenting my stuff in front of audience because you never know on what PC you have to run your presentations.)
Comment 19 muso 2018-07-25 16:37:29 UTC
Created attachment 143755 [details]
a test ODG file

You can see that the file path is always an absolute path.
Comment 20 muso 2018-07-25 16:39:12 UTC
Created attachment 143756 [details]
The LO hyperlink dialog

The dialog shows you that the created link is absolute despite the ODG and the MP4 is in the same folder.
Comment 21 muso 2018-07-25 16:39:56 UTC
Created attachment 143757 [details]
Acrobat file execution dialog

Also the execution dialog of Acrobat shows you that the created link is absolute.
Comment 22 Regina Henschel 2018-07-25 20:07:34 UTC
Created attachment 143761 [details]
ExampleWithRelativeLink

Unpack the file and run the included presentation. I hope it will be clearer then.
Comment 23 muso 2018-07-25 23:34:24 UTC
> Unpack the file and run the included presentation. I hope it will be clearer
> then.
Thanks you for your file but it shows again the bug as I described it:

- take your presentation and export it as PDF.
result: the link is an absolute link. Move your PDF to another folder and you will get troubles.
expected result: the link is a relative link

- the link contains the URI "file:". For some file types one needs the URI "run:" to assure that the linked file is executed.

So again, LO does not provide a way to create relative file links and one cannot use all defined URIs for links.

(You might wonder why I insist on a PDF. In real life you never know on what PC you have to hold your presentation. Many PCs don't have LO installed. With the PDF you are always on the right side, also on Linux and Mac.)
Comment 24 Regina Henschel 2018-07-26 07:29:39 UTC
Generating PDF from a presentation is a different task. But I have tried it using File > Export > PDF. And it works for me. The link still opens "Movie & TV", which is the default player for mp4 on my system. And if I change my Windows 10 to use VLC as default player for mp4, then the link in the PDF file opens VLC.

Perhaps you have forgotten to enable the option "Export URLs relative to file system" on tab Links in the PDF-export dialog?

I'll attach a folder, which has the generated PDF, so that you can test it.


So this issue is a "Works for me".
Comment 25 Regina Henschel 2018-07-26 07:37:40 UTC
Created attachment 143768 [details]
presentation and generated PDF

Regarding the Acrobat file execution dialog: Do not wonder about the shown path. Simple allow the access. The next step will be, that Acrobat Reader ask you to allow to start the app.

Acrobat Reader does the same as LibreOffice, it does not show the saved link, but shows the calculated link in the current situation.