FS#28839 - Query package details by name (w/ patch)
Attached to Project:
AUR web interface
Opened by Dario Giovannetti (kynikos) - Friday, 09 March 2012, 12:38 GMT
Last edited by Lukas Fleischer (lfleischer) - Sunday, 04 November 2012, 11:46 GMT
Opened by Dario Giovannetti (kynikos) - Friday, 09 March 2012, 12:38 GMT
Last edited by Lukas Fleischer (lfleischer) - Sunday, 04 November 2012, 11:46 GMT
|
Details
Currently package-detail pages are retrieved only with
"packages.php?ID=#".
Here I provide two possible patches that could enable querying by package name: the first one just adds an elseif in packages.php, the second one rewrites an if block avoiding some duplication of code. A new GET variable is introduced, "NAME", and this way package details could be queried also with "packages.php?NAME=pkgname". If "NAME" conflicts with an existing variable, possible alternatives are "PNAME", "PKGNAME", "pkgname" and so on. This request is the result of the discussion in https://wiki.archlinux.org/index.php/User_talk:Det#Templates%20vs%20 links. |
This task depends upon
Closed by Lukas Fleischer (lfleischer)
Sunday, 04 November 2012, 11:46 GMT
Reason for closing: Implemented
Additional comments about closing: Implemented in 2.0.0.
Sunday, 04 November 2012, 11:46 GMT
Reason for closing: Implemented
Additional comments about closing: Implemented in 2.0.0.
query_by_name_2t.patch (1 KiB)
It's based on the idea that, sooner or later in the code, $_GET['ID'] must be set unless we want to rewrite the whole project, since that variable is required by many functions; so, let's choose sooner and set it immediately from $_GET['NAME'] :)
By the way I've also checked more accurately if "NAME" is already used and couldn't find anything, so IMHO the name is ok (unless you don't like it for other reasons). I couldn't find a file or a comment where GET variables are listed with descriptions, but if you're keeping one and want a patch also for that I'll prepare it.
FS#21600and I already posted patches for this to aur-dev [1] about one and a half years ago. No idea why I never merged them into master.[1] http://mailman.archlinux.org/pipermail/aur-dev/2010-November/001356.html
[1] http://mailman.archlinux.org/pipermail/aur-dev/2012-March/001994.html