Bug 452920 - Opening any manpage in the Documentation pane results in "Manual Page Viewer Error"
Summary: Opening any manpage in the Documentation pane results in "Manual Page Viewer ...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Documentation viewer (show other bugs)
Version: 5.8.220400
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-23 18:38 UTC by nsane457
Modified: 2022-05-31 11:07 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nsane457 2022-04-23 18:38:16 UTC
SUMMARY

Opening the Documentation pane, 


STEPS TO REPRODUCE

1. O[en the Documentation pane.
2.  Select "Man Page" from the drop-down menu
3. Select any Category entry and any Man Page entry

OBSERVED RESULT

eg., chmod (1):

> Manual Page Viewer Error
> No man page matching “__fsetlocking (3)” could be found.
> 
> Check that you have not mistyped the name of the page, and note that man page names are case sensitive.
> 
> If the name is correct, then you may need to extend the search path for man pages, either using the $MANPATH environment variable or a configuration file in the ‘/etc’ directory.`

stdout:

> js: Not allowed to load local resource: file:///usr/share/kdevmanpage/manpagedocumentation.css

EXPECTED RESULT

Show the manpage.

SOFTWARE/OS VERSIONS

Operating System: Gentoo Linux 2.8
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.3
Kernel Version: 5.17.3-gentoo (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 5800H with Radeon Graphics
Memory: 27.3 GiB of RAM
Graphics Processor: AMD RENOIR
Comment 1 Igor Kushnir 2022-05-03 07:23:35 UTC
ManPageModel::showItem() [at https://invent.kde.org/kdevelop/kdevelop/-/blob/3427bd11ff34b18d3efdec3b4f23c65c0316a6e0/plugins/manpage/manpagemodel.cpp#L163] constructs a manual page URL as `sectionUrl/page`. For example (found via debugging KDevelop), sectionUrl="man:/(7)"; page="bootup (7)". When I try opening the URL on the command line via `xdg-open "man:/(7)/bootup (7)"`, KHelpCenter shows the same Manual Page Viewer Error page. When I shorten the URL, i.e. `xdg-open "man:/(7)/bootup"`, KHelpCenter opens the expected Man page. Either m_manMap contains incorrect URLs or ManPageModel::showItem() should adjust them...
Comment 2 Igor Kushnir 2022-05-03 15:14:58 UTC
By the way, this seems to be a relatively recent regression.
Comment 3 Igor Kushnir 2022-05-03 15:18:48 UTC
I suspect the regression is in KDE Frameworks. Or perhaps KDevelop has to be adapted to some recent framework changes. I checked an old virtual machine (OpenSUSE Leap 15.1), and the links in old KDevelop 5.5 are correct, e.g. "man:/(7)/gnupg".
Comment 4 Bug Janitor Service 2022-05-30 18:27:35 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/kio-extras/-/merge_requests/159
Comment 5 nsane457 2022-05-30 22:39:25 UTC
(In reply to Bug Janitor Service from comment #4)
> A possibly relevant merge request was started @
> https://invent.kde.org/network/kio-extras/-/merge_requests/159

I can confirm patching kio-extras-22.04.1 with the PR diff resolves the issue on my end.
Comment 6 Jonathan Marten 2022-05-31 05:27:53 UTC
Git commit d676e8085e86b7f78a86877c038bd98bcc02bde4 by Jonathan Marten, on behalf of Igor Kushnir.
Committed on 31/05/2022 at 05:26.
Pushed by marten into branch 'release/22.04'.

man: remove the section suffix from page names in listDir()

After recent major changes to man's listDir() (starting at
223de3ec8cde479fbe7f102c76b756cacbedbda5 and ending with
1d752c0497868fb07abd574f260f85c1ce62dfc9) man page names acquired
section suffixes in parentheses. For example, "aio.h" became
"aio.h (0p)". This page name format change broke URLs formed by joining
a section URL and a page name, e.g. "man:/(7)" + '/' + "bootup (7)".
The `xdg-open "man:/(7)/bootup (7)"` command opens this broken link in
KHelpCenter, which displays the "Manual Page Viewer Error" page.
The added section suffixes also break displaying man pages in KDevelop's
Man Pages documentation plugin.

Revert this breaking change by removing the section suffix rather than
reformatting it into parentheses.
FIXED-IN: 22.04.02

M  +2    -2    man/kio_man.cpp

https://invent.kde.org/network/kio-extras/commit/d676e8085e86b7f78a86877c038bd98bcc02bde4
Comment 7 Jonathan Marten 2022-05-31 11:07:25 UTC
Git commit d27defbd9ddbbd23ac16c90851e0fa769087f85d by Jonathan Marten, on behalf of Igor Kushnir.
Committed on 31/05/2022 at 11:04.
Pushed by marten into branch 'master'.

man: remove the section suffix from page names in listDir()

After recent major changes to man's listDir() (starting at
223de3ec8cde479fbe7f102c76b756cacbedbda5 and ending with
1d752c0497868fb07abd574f260f85c1ce62dfc9) man page names acquired
section suffixes in parentheses. For example, "aio.h" became
"aio.h (0p)". This page name format change broke URLs formed by joining
a section URL and a page name, e.g. "man:/(7)" + '/' + "bootup (7)".
The `xdg-open "man:/(7)/bootup (7)"` command opens this broken link in
KHelpCenter, which displays the "Manual Page Viewer Error" page.
The added section suffixes also break displaying man pages in KDevelop's
Man Pages documentation plugin.

Revert this breaking change by removing the section suffix rather than
reformatting it into parentheses.

(cherry picked from commit d676e8085e86b7f78a86877c038bd98bcc02bde4)
FIXED-IN: 22.04.02

M  +2    -2    man/kio_man.cpp

https://invent.kde.org/network/kio-extras/commit/d27defbd9ddbbd23ac16c90851e0fa769087f85d