[aur-dev] [PATCH 2/3] pkgfuncs.inc.php: allow all DB funcs to take handle arg

Dan McGee dpmcgee at gmail.com
Thu Aug 11 10:03:43 EDT 2011


On Thu, Aug 11, 2011 at 8:53 AM, Lukas Fleischer
<archlinux at cryptocrack.de> wrote:
> On Thu, Aug 11, 2011 at 08:42:34AM -0500, Dan McGee wrote:
>> On Thu, Aug 11, 2011 at 8:24 AM, Lukas Fleischer
>> <archlinux at cryptocrack.de> wrote:
>> > On Wed, Aug 10, 2011 at 06:20:06PM -0500, Dan McGee wrote:
>> >> Allows handle reuse if one is available.
>> >>
>> >> Signed-off-by: Dan McGee <dan at archlinux.org>
>> >> ---
>> >>  web/lib/pkgfuncs.inc.php |  164 ++++++++++++++++++++++++++++------------------
>> >>  1 files changed, 101 insertions(+), 63 deletions(-)
>> >>
>> >
>> > This one looks good to me, except for two lines you probably removed
>> > unintentionally (see below). This also needs to be rebased on the
>> > package merging patches in my working tree. I fixed the missing lines
>> > issue and pushed a rebased version of this patch to my working branch.
>> I see and updated lukas/wip but not lukas/working, is that what you meant?
>>
>> >> @@ -276,15 +300,15 @@ function pkgname_is_blacklisted($name) {
>> >>
>> >>  # display package details
>> >>  #
>> >> -function package_details($id=0, $SID="") {
>> >> -     $atype = account_from_sid($SID);
>> >> -     $uid = uid_from_sid($SID);
>> >
>> > These two lines shouldn't be removed.
>>
>> I'll make it more clear and increase my patch count, but they most
>> definitely should and it wasn't unintentional at all. It also removes
>> two completely useless queries for every single package load (actually
>> 4 total if I interpreted the code right when writing this patch, but
>> that is a different story). Find where these variables are used and
>> I'll buy you a beer.
>
> Apply that patch, go to any package details page and you won't be able
> to vote, enable notifications, ...

Ew. Why isn't this being done in the template itself, just as we don't
pass along magic submitter, maintainer, updated_time, etc. magic
variables that just have to be defined?

> ----
> Notice: Undefined variable: uid in /srv/http/aur/web/template/pkg_details.php on line 4
>
> Notice: Undefined variable: atype in /srv/http/aur/web/template/pkg_details.php on line 5
>
> Notice: Undefined variable: atype in /srv/http/aur/web/template/pkg_details.php on line 5
>
> Notice: Undefined variable: atype in /srv/http/aur/web/template/pkg_details.php on line 50
>
> Notice: Undefined variable: atype in /srv/http/aur/web/template/pkg_details.php on line 50
> ----
>
> Can I choose any beer I want? :)
Next time I see you, first round on me of anything you choose.

>>
>> Anyway, split into two patches, based on master, on my working branch.
>> If you want rebased patches, then push the work you want it based on
>> to master please- it isn't fun to aim at moving targets, which is what
>> I consider any other working branch.
>
> Those patches are still being discussed on the ML. I will push them as
> soon as there are no more objections.


More information about the aur-dev mailing list