Bug 151187

Summary: 'cpan:' shortcut broken, gives wrong search results - (PATCH ATTACHED)
Product: [Applications] konqueror Reporter: Richard Hartmann <richih-kde>
Component: generalAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: adawit, kollix
Priority: NOR    
Version: 3.5   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In: 4.8.1
Sentry Crash Report:
Attachments: The patch from the initial bug report

Description Richard Hartmann 2007-10-22 17:53:14 UTC
Version:            (using KDE KDE 3.5.8)
Installed from:    Debian testing/unstable Packages

When you do not supply a second parameter, cpan: will default to dist. This makes searching for modules that do not have their own namespace impossible.

Test case:
http://search.cpan.org/search?mode=dist&query=POE%3A%3AWheel%3A%3ARun
http://search.cpan.org/search?query=POE%3A%3AWheel%3A%3ARun

As you can see, only the second query gives the expected result.

Fix:
Do not default to dist, default to empty

Patch:
--- /home/richih/.kde/share/services/searchproviders/cpan2.desktop      2007-10-22 17:51:30.169619342 +0200
+++ /home/richih/.kde/share/services/searchproviders/cpan3.desktop      2007-10-22 17:44:31.645768978 +0200
@@ -1,8 +1,8 @@
 [Desktop Entry]
 Charset=
 Hidden=false
-Query[en_US]=http://search.cpan.org/search?mode=\\{mode,2,"dist"}&query=\\{query,q,1}
+Query[en_US]=http://search.cpan.org/search?mode=\\{mode,2,""}&query=\\{query,q,1}
 ServiceTypes=SearchProvider
 Type=Service
Comment 1 Richard Hartmann 2007-12-18 18:55:35 UTC
In light of the impeding KDE4 release, I am going through all bug reports I am involved in. To the best of my knowledge, this issue is still open.
Comment 2 Christoph Burger-Scheidlin 2009-02-08 15:22:45 UTC
Created attachment 31125 [details]
The patch from the initial bug report

Credit to the original reporter, not my own work.
Attached solely so that bugzilla knows that there is a patch
Comment 3 Richard Hartmann 2009-02-08 16:06:21 UTC
Thanks for the housekeeping :)
Comment 4 Dawit Alemayehu 2012-01-03 21:01:15 UTC
This makes sense. I will see if I can commit this one for 4.8.0. Otherwise, it will have to wait for 4.8.1.
Comment 5 Dawit Alemayehu 2012-01-06 22:05:26 UTC
Git commit b70933b23e8d205957d6df99a3672ebec54d0c4e by Dawit Alemayehu.
Committed on 03/01/2012 at 21:59.
Pushed by adawit into branch 'KDE/4.8'.

When the second parameter is not specified default to empty not "dist".
FIXED-IN: 4.8.1

M  +90   -90   kurifilter-plugins/ikws/searchproviders/cpan.desktop

http://commits.kde.org/kde-runtime/b70933b23e8d205957d6df99a3672ebec54d0c4e
Comment 6 Dawit Alemayehu 2012-01-06 22:07:15 UTC
Git commit 3d78686e2592fca34ccfe068635d7c4c1fbfbed2 by Dawit Alemayehu.
Committed on 03/01/2012 at 21:59.
Pushed by adawit into branch 'master'.

When the second parameter is missing default to empty not "dist".
FIXED-IN: 4.8.1
(cherry picked from commit b0efe1cbe84b4eb2e78d28896a5c450c314ce2bc)

M  +90   -90   kurifilter-plugins/ikws/searchproviders/cpan.desktop

http://commits.kde.org/kde-runtime/3d78686e2592fca34ccfe068635d7c4c1fbfbed2