Bug 129322 - MacOS Calc Error on Hyperlink- File is not an absolute URL that can be passed to an external application to open it
Summary: MacOS Calc Error on Hyperlink- File is not an absolute URL that can be passed...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.2.8.2 release
Hardware: x86 (IA32) macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-11 09:54 UTC by G
Modified: 2019-12-16 21:13 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Screen Capture-Error (138.24 KB, image/png)
2019-12-11 09:56 UTC, G
Details

Note You need to log in before you can comment on or make changes to this bug.
Description G 2019-12-11 09:54:59 UTC
Description:
Example:
(MacOS) New Calc File (saved File as "Error-Hyperlink.xls")

on Cell A1 (or any other) input formula:
=HYPERLINK("X/PIC.JPG","PIC.JPG")

Error:
"file:///Users/a/Desktop/Tst-Hyperlink/X/PIC.JPG" is not an absolute URL that can be passed to an external application to open it.

Important Data:
Error is on MacOs, tested on MacOS 10.15.2
LibreOffice Version 6.2.8.2
If you create the same file in Win X, it Does Work well
I have tested this error only on MacOS.

Steps to Reproduce:
1. MacOS computer
2. Create Calc File (in this case only tested as .xls file"
3. insert formula: '=HYPERLINK("X/PIC.JPG","PIC.JPG")'
4. Command+Click on formula to follow Hyperlink

Actual Results:
"file:///Users/a/Desktop/Tst-Hyperlink/X/PIC.JPG" is not an absolute URL that can be passed to an external application to open it.

Expected Results:
Open File. If you create a file called "Pic.JPG" inside a sub-folder "X", it should open it. 

The same formula Works in Windows X, in MacOS it does not.


Reproducible: Always


User Profile Reset: Yes



Additional Info:

The only comment that I found is by Mike Kaganski 
	
Exactly because of the localhost issue. So no, we cannot ignore the localhost issue.

file:///volume/my documents/testfile.txt is a bad URL for Windows: Windows doesn't have a root (unlike Unix-like systems), so nothing like path /volume/my documents/testfile.txt (starting from the forward-slash). Initially, the URL looks correct: file://localhost/volume/my documents/testfile.txt - which should convert to UNC path \\localhost\volume\my documents/testfile.txt, which refers to a network share attached to your box, but since the localhost part gets stripped away, it ends up in that invalid thing.

On the other hand, file:///c:/volume/my documents/testfile.txt gives correct path, and isn't affected by the bug.

Can be found in https://ask.libreoffice.org/en/question/203841/hyperlink-in-spreadsheet-works-in-excel-fails-in-libreoffice/
Comment 1 G 2019-12-11 09:56:23 UTC
Created attachment 156474 [details]
Screen Capture-Error
Comment 2 V Stuart Foote 2019-12-11 13:12:56 UTC
Another manifestation of fix for CVE-2019-9847

Corrected with https://gerrit.libreoffice.org/#/c/82749/ for bug 128538

Fixed for 6.3.4, 6.4.0 and master/6.5.0

*** This bug has been marked as a duplicate of bug 125607 ***
Comment 3 Stephan Bergmann 2019-12-11 20:58:39 UTC
This bug is not a duplicate of bug 128538.  That bug is about opening links that denote folders, while this bug is about opening links that denote files.

I cannot reproduce this bug with LO 6.2.8.2 on macOS.  In my Desktop folder I create the Error-Hyperlink.xls and the folder X containing a jpeg file PIC.JPG.  Clicking the hyperlink in Calc opens the jpeg file in Preview.  This works even if I make the case-spelling of the actual file name (e.g., Pic.JPG) differ from the PIC.JPG spelling in the =HYPERLINK(...) formula (as would be expected for a case-insensitive file system on macOS).  However, if I remove the Desktop/X/PIC.JPG file, I get the (unfortunately somewhat misleading, for that scenario) "... is not an absolute URL that can be passed..." error message.

Your comment 0 mentions a Desktop/Tst-Hyperlink sub-folder.  Both your Error-Hyperlink.xls and your X sub-folder are contained in that Desktop/Tst-Hyperlink folder?
Comment 4 G 2019-12-13 01:23:33 UTC
I forgot to mention (I didn't realized) that the folder where Error-Hyperlink.xls file is stored, is on a Shared folder of a NAS, and not on my desktop/own computer.
And that might produce an error on the UNC translation.
Comment 5 Stephan Bergmann 2019-12-16 21:13:14 UTC
(In reply to G from comment #4)
> I forgot to mention (I didn't realized) that the folder where
> Error-Hyperlink.xls file is stored, is on a Shared folder of a NAS, and not
> on my desktop/own computer.

Not sure how this should make a difference.

* So your document is indeed at /Users/ga/Desktop/Tst-Hyperlink/Error-Hyperlink.xls (as attachment 156474 [details] suggests)?

* What is the output of typing "mount" (without the quotes) in a Terminal window?

* What is the output of typing "ls /Users/ga/Desktop/Tst-Hyperlink/X" (without the quotes) in a Terminal window?