Bug 144769 - UI Warning about unavailable hyperlink targets needs to UTF-encode the target file name
Summary: UI Warning about unavailable hyperlink targets needs to UTF-encode the target...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
7.3.0.0 alpha0+
Hardware: All Windows (All)
: medium normal
Assignee: Gabor Kelemen (allotropia)
URL:
Whiteboard: target:7.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-28 14:27 UTC by NISZ LibreOffice Team
Modified: 2021-11-23 13:40 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of the problem in Calc (37.71 KB, image/png)
2021-09-28 14:27 UTC, NISZ LibreOffice Team
Details
How it looks on Linux (278.44 KB, image/png)
2021-09-29 17:07 UTC, Gabor Kelemen (allotropia)
Details
The warning dialog after the proposed patch (28.47 KB, image/png)
2021-11-12 19:10 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2021-09-28 14:27:16 UTC
Created attachment 175322 [details]
Screenshot of the problem in Calc

When a spreadsheet contains a hyperlink to another file, whose name is UTF-encoded and not currently available, clicking the hyperlink pops up a warning about the missing target file.
The name of the target file is not UTF-encoded, so it’s not really readable when the file name contains UTF-characters.

Steps to reproduce:
    1. Download attachment 152339 [details] from bug 54204
       It contains some hyperlinks to attachment 152340 [details] whose name was originally Tükörfúrógép.xlsx (although Bugzilla mangled it) – but do not download this one.
    2. Open the file and Ctrl-click on the hyperlinks in A1:A3

Actual results:
An error dialog pops up, since the target file is not available. It says: 
"file:///C:/Users/kelemengabo/Documents/T%C3%BCk%C3%B6rf%C3%BAr%C3%B3g%C3%A9p.xlsx#'%C3%81rv%C3%ADzt%C5%B1r%C5%91%20t%C3%BCk%C3%B6rf%C3%BAr%C3%B3g%C3%A9p%201'!A1" cannot be passed to an external application to open it (e.g., it might not be an absolute URL, or might denote no existing file).

Expected results:
The file name in the above error message should be UTF-encoded thus readable.

LibreOffice details:
Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: b60b6bfaafa1315e07108dba50f016975b619c59
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL
Comment 1 Xisco Faulí 2021-09-29 15:34:13 UTC
No error message in

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: ac34bafb6cad056f843ff3ff0dee293bf1e18c56
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 2 Xisco Faulí 2021-09-29 15:34:43 UTC
Same with GEN
Comment 3 Gabor Kelemen (allotropia) 2021-09-29 17:07:55 UTC
Created attachment 175377 [details]
How it looks on Linux

Indeed no dialog in 

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: b63c5ade3554a42def4bce94f9fd67ea66528214
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: hu-HU (hu_HU.UTF-8); UI: en-US
Calc: threaded

A similar but not the same message is visible on the UI, coming from gio:

gabor@voldemort:~/src/bb73$ gio: file:///home/gabor/Dokumentumok/peldadoksik/T%C3%BCk%C3%B6rf%C3%BAr%C3%B3g%C3%A9p.xlsx#'%C3%81rv%C3%ADzt%C5%B1r%C5%91%20t%C3%BCk%C3%B6rf%C3%BAr%C3%B3g%C3%A9p%201'!A1: Error when getting information for file “/home/gabor/Dokumentumok/peldadoksik/Tükörfúrógép.xlsx”: No such file or directory

A quick search show the location of the Windows-specific string:

gabor@voldemort:~/src/core$ gg STR_NO_ABS_URI_REF
include/sfx2/strings.hrc:#define STR_NO_ABS_URI_REF                      NC_("STR_NO_ABS_URI_REF", "\"$(ARG1)\" cannot be passed to an external application to open it (e.g., it might not be an absolute URL, or might denote no existing file).")
sfx2/source/appl/openuriexternally.cxx:                                                                 SfxResId(STR_NO_ABS_URI_REF)));
Comment 4 Gabor Kelemen (allotropia) 2021-11-12 19:10:50 UTC
Created attachment 176218 [details]
The warning dialog after the proposed patch

Proposed patch: https://gerrit.libreoffice.org/c/core/+/125121 

The string has changed after https://cgit.freedesktop.org/libreoffice/core/commit/?id=70009098fd70df021048c540d1796c928554b494 but the problem stayed the same.
Comment 5 Commit Notification 2021-11-23 12:58:55 UTC
Gabor Kelemen committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/db0f2c29bf3a6ad5a08f8524ea0e65aa90792bb2

tdf#144769 Properly encode file name in error dialog

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.