Bug 114522 - Writer hyperlink to the bookmark in filename with # (sharp) character.
Summary: Writer hyperlink to the bookmark in filename with # (sharp) character.
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
5.1.6.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Hyperlink-Dialog
  Show dependency treegraph
 
Reported: 2017-12-18 07:13 UTC by Harry
Modified: 2020-12-19 18:01 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of hyperlink-dialog (23.51 KB, image/png)
2017-12-19 01:10 UTC, Regina Henschel
Details
screenshot (119.90 KB, image/jpeg)
2017-12-19 02:30 UTC, Harry
Details
hyperlink dialogbox (57.35 KB, image/jpeg)
2017-12-20 00:17 UTC, Harry
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Harry 2017-12-18 07:13:12 UTC
Description:
Writer hyperlink to the bookmark in filename with # (sharp) character doesn't distinguish # in the filename from # which is a separator for bookmark. 

Steps to Reproduce:
1.make .odt file with the filename which include "#" character. 
2.make bookmark in the above file.
3.open another .odt and make hyperlink to the above bookmark.

Actual Results:  
Insert Hyperlink dialogbox opens sub dialogbox titled 'Target in document' with a msg 'couldn't open the document'.

Expected Results:
Normally, it should just have made a hyperlink to the bookmark in .odt. 


Reproducible: Always


User Profile Reset: No



Additional Info:
But just after I upgraded Ubuntu 14.* to 16.04, 'coultn't open the document' error occurs.


User-Agent:
Comment 1 Regina Henschel 2017-12-18 22:26:31 UTC
Cannot confirm it. Hyperlink is correctly created and works in Version: 6.1.0.0.alpha0+ (x64)
Build ID: d73857e7d7f6a5bf38c6a2f396832faabaef65e2
CPU threads: 8; OS: Windows 10.0; UI render: GL; 
TinderBox: Win-x86_64@62-TDF, Branch:master, Time: 2017-12-12_17:37:14
Locale: de-DE (de_DE); Calc: CL

Does the hyperlink to the document, which is created in the hyperlink dialog, has a %23 instead of the # in the file name? That is needed and works on Windows.
Comment 2 Harry 2017-12-19 00:27:29 UTC
Hi  Regina Henschel, 

Of course '#', not '%23' or anything. I made a file of which filename is 'true#333.odt' and made a bookmark in it named 'testbookmark' by alt-i, k.

And I made another file named 'test.odt'and made a hyperlink on the text 'testhyperlink' by selecting it and ctrl-k to point to the above 'testbookmark' in 'true#333.odt'. But after choosing 'true#333.odt' if u try to click the bookmark selection icon (crossbar over the circle), it would not display bookmark list of 'true#333.odt' but the error msg 'Couldn't open the document'. 

If u force it by filling the text box with 'testbookmark' by hand-typing, it will pass anyway. But the hyperlink doesn't work and if u edit the hyperlink again it will show the filename field with 'true' and the bookmark field with '#333.odt#testbookmark'. 

It means Libreoffice is confusing the bookmark separator '#' with the letter '#' in the filename. 

As mentioned already, this happened just after upgraded from Ubuntu 14 to Ubuntu 16.04 which was fresh installed on the empty HDD. Unfortunately I don't know the version number of Libreoffice which I used to use in Ubuntu 14 which was erased permanently. And I used this kind of hyperlink-bookmark for years without this kind of problem.

Thank you.
Comment 3 Regina Henschel 2017-12-19 01:10:06 UTC
Created attachment 138514 [details]
Screenshot of hyperlink-dialog

Please compare my screenshot from Windows with yours. If I mark the text in the document and press CTRL+k I get the Hyperlink-dialog. Next I click on icon "Document" and then on the icon "Open file" top-right. I choose my file "Kannweg#Bookmark.odt"; you see the path in the "Path" field. It has a # in the file name. But below the field "Target" at the label URL you see, how the path is written in UNC notation. Notice the change of # to %23.

Perhaps you can add the analogous screenshot for your environment. I suspect, that it might be a Ubuntu only problem.

And please have a look in Help > About, which LibreOffice version do you have. The current productive version is 5.3.7. Perhaps you need to update your LibreOffice.
Comment 4 Harry 2017-12-19 02:30:51 UTC
Created attachment 138517 [details]
screenshot

screenshot
Comment 5 Harry 2017-12-19 02:33:36 UTC
Regina Henschel, 

Attached my dialogbox. Plz check. (My mistake to hava attached in the previous comment)

Different from your case, my Libreoffice preserve "#" character (not converted into %23 ASCII code convention). 

FYI, I updated my Libreoffice to Version: 5.4.3.2 Build ID: 1:5.4.3~rc2-0ubuntu0.16.04.1~lo1.

Plz help.
Comment 6 Regina Henschel 2017-12-19 13:01:39 UTC
In contrast to Windows you have already an UNC notation in the Path field. Therefore I would try to manually replace the # with %23 in the Path field before going to select the bookmark.

Do you use the system file picker dialog? You can try to switch to LibreOffice dialogs or vs in Tools > Options > General.

Unfortunately I have no Linux and cannot test it there. So I cannot set the issue to New. I have tried older Windows versions as well. Non of them get the path wrong.
Comment 7 Harry 2017-12-20 00:17:17 UTC
Created attachment 138540 [details]
hyperlink dialogbox

Regina Henschel,

Thank you for your kind advise.

Please see the attached screen shot I made. 

I found out that when I click the recent files icon (the read arrow is pointing in the attached image) and choose the target file the '#' character remains as it is so that Libreoffice confuses '#' in filename with '#' as a hyperlink separator, but if I click the browser icon (the green arrow is pointing) and choose the target file '#' is converted to '%23' and everything goes OK. 

This is a very strange thing because I hardly click the file browser icon in this job and I got the problem as soon as I upgraded to Ubuntu 16.04 from 14. (though don't know the change of Libreoffice versions)

PS. It turned out there's nothing to do with this problem between 'libreoffice dialogs' and 'ubunto file browser dialog'.
Comment 8 Regina Henschel 2017-12-20 17:34:15 UTC
I think, that it is not a bug, if the list contains items, which are unsuitable, because you can enter, what ever you want.

But I think, that the problem with special characters in a path should be explained somewhere. Currently I see no hint in the help texts. Therefore I change the component to Documentation.

The current text in topic "Document" is:
"Path
Enter a URL for the file that you want to open when you click the hyperlink. If you do not specify a target frame, the file opens in the current document or frame."

Here should a hint to the browse button be added and a hint, that special characters in a path has to be %-escaped and that this will be done automatically by selecting the file via file picker via browse-button.
Comment 9 Harry 2017-12-21 00:43:54 UTC
> I think, that it is not a bug, if the list contains items, which are 
> unsuitable, because you can enter, what ever you want.

It might be a bug since in the previous version I hadn't had this problem for years while doing the same job.

> But I think, that the problem with special characters in a path should be 
> explained somewhere. Currently I see no hint in the help texts. Therefore I 
> change the component to Documentation.

That is a good idea. But it's like moving the problem to the users from the Libreoffice embedded code mistakes. If the user could choose the recent accessed file from the file list which Libreoffice provided, Libreoffice should convert '#' character to %-escaped one automatically as it used to do that for years.
Comment 10 sdc.blanco 2020-12-19 16:34:54 UTC
Cannot reproduce.  Followed STR.  Able to make a Hyperlink to a file with # in filename.  Only tested with Windows.  

If it also works in Linux, then I propose that this bug should be closed as WFM -- no need to change the documentation.

Version: 7.2.0.0.alpha0+ (x64)
Build ID: 368c56144aab5794c39d5bc2082d9b3d6d7cebdb
CPU threads: 8; OS: Windows 10.0 Build 19041; UI render: Skia/Vulkan; VCL: win
Locale: en-CA (en_DK); UI: en-GB
Calc: threaded
Comment 11 BogdanB 2020-12-19 16:56:19 UTC
I tried this also in 
Version: 7.0.4.2
Build ID: dcf040e67528d9187c66b2379df5ea4407429775
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded


The link is like this: file:///home/user/Desktop/true%23333.odt
#333 was transformed in %23333, but the link is working as expected
Comment 12 sdc.blanco 2020-12-19 17:59:11 UTC
(In reply to BogdanB from comment #11) 
> The link is like this: file:///home/user/Desktop/true%23333.odt
> #333 was transformed in %23333, but the link is working as expected
Same result in Windows. The # is represented as %23, and hyperlink works.
Thanks for checking Bogdan.

(fwiw, if the Document Path in the hyperlink dialog is edited manually (to change %23 to #), then an error message appears when clicking on the hyperlink -- but that was not the topic of this bug report).
Comment 13 sdc.blanco 2020-12-19 18:01:18 UTC
(In reply to Harry from comment #0)
> Expected Results:
> Normally, it should just have made a hyperlink to the bookmark in .odt. 
Based on comment 10 and comment 11 -- this is what happens now in both Windows and Linux.  Closing as WORKSFORME, with no need for documentation change.