Bug 446869 - Dolphin handles broken symlinks in an unexpected way (try to open link as file)
Summary: Dolphin handles broken symlinks in an unexpected way (try to open link as file)
Status: REPORTED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 21.12.0
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-12 08:59 UTC by Kishore Gopalakrishnan
Modified: 2025-01-07 14:03 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Error appearing on Dolphin (32.68 KB, image/png)
2025-01-07 14:01 UTC, Dilam
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kishore Gopalakrishnan 2021-12-12 08:59:29 UTC
SUMMARY
When the user tries to open a broken symlink, Dolphin asks the user to choose an application, instead of first raising some sort of error or warning.

STEPS TO REPRODUCE
1. Run the following command in any directory: ln -s /location_that_does_not_exist brokenlink 
2. Navigate to that directory in Dolphin and click on the link to open it

OBSERVED RESULTS
Dolphin directly asks the user which application should be used to open the file.

EXPECTED RESULTS
Dolphin should first warn the user that the symlink is broken.
Other programs detect this correctly, e.g. running `file brokenlink` in the terminal gives the following output:
brokenlink: broken symbolic link to /location_that_does_not_exist

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2
Kernel Version: 5.15.7-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 8 × AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
Memory: 21.5 GiB of RAM
Graphics Processor: AMD Radeon Vega 8 Graphics

ADDITIONAL INFORMATION
'Right-click > Show Target' correctly complains that the destination is not accessible.
Comment 1 Dilam 2025-01-07 14:01:49 UTC
Created attachment 177168 [details]
Error appearing on Dolphin

We are now getting an error message, both when opening in Dolphin and when opening on Desktop.
The error message is "WorkingDirectory= expects an absolute path or '~' " which is not a good message. The broken given path is an absolute path. It should instead say something like "The given path is invalid." and this message should be translated by the OS to the language of the user (not the case here).

Also, when trying to open in Dolphin, I see that KWrite try to open the file and close itself (without a window to open, it just appear and disappear in the taskbar). So there is definitely something else than the content of the error to fix.