[Koha-patches] [PATCH] bugfix for 2899

Joe Atzberger joe.atzberger at liblime.com
Thu Jul 23 23:25:17 CEST 2009


> -(scalar @$results) and $template->param(TAGLOOP => $results);
> +my @orderedresult = sort { $a->{'term'} cmp $b->{'term'} } @$results;
> +(scalar @$results) and $template->param(TAGLOOP => \@orderedresult );
>
>

You shouldn't have to resort the results in the script when you can just
give the right argument to get_approval_rows($arghash), like:

- my $arghash = {approved=>1, limit=>$limit, 'sort'=>'-weight_total'};
+ my $arghash = {approved=>1, limit=>$limit, 'sort'=>'+term'};

Then it will get down the SQL level where the sorting is most efficient.

-- 
Joe Atzberger
LibLime - Open Source Library Solutions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/koha-patches/attachments/20090723/0704eeb3/attachment-0002.htm>


More information about the Koha-patches mailing list