[Koha-patches] [PATCH] Fixing 2516 : Ordering names with multiple keys

henridamien.laurent henridamien.laurent at biblibre.com
Wed Aug 27 17:15:54 CEST 2008


Galen Charlton a écrit :
> Hi Henri,
>
> On Fri, Aug 22, 2008 at 10:19 AM, Henri-Damien LAURENT
> <henridamien.laurent at biblibre.com> wrote:
>   
>> +    $orderby.=",firstname,othernames" if $orderby=~/name/;
>>     
>
> I'm not sure how this patch fixes bug 2516 as described.  The
> SearchMember call in circ/circulation.pl uses 'cardnumber' for
> $orderby; furthermore, around line 529 of circ/circulation.pl, the
> results of the SearchMember call are sorted again anyway:
>
>     foreach (
>         sort {
>                 lc $a->{'surname'}
>               . lc $a->{'firstname'} cmp lc $b->{'surname'}
>               . lc $b->{'firstname'}
>         } @$borrowerslist
>       )
>
> Perhaps the fix needs to be there?
>
> Regards,
>
> Galen
>   
Hi,
In fact, I couldnot reproduce the bug on my box, So I tried to send a 
patch, but couldnot reproduce the problem nor be sure that it was the 
correct answer.
Maybe a " " (space character) was mistakenly added at the end of surname 
or at the begining of firstname, causing disruption in order.

But the order you point looks strange to me.
For instance
HADJ Alain would then be before HAD Laurent, which should not be the 
case imho.
maybe
(lc $a->{'surname'} cmp lc $b->{'surname'} ?lc $a->{'surname'} cmp lc 
$b->{'surname'}:lc $a->{'firstname'} cmp lc $b->{'firstname'})
would be ok there. (tested)
But how does it come that ordering by surname could send correct order 
if we donot order not only by surnames but also with firstnames ?
maybe we should also chomp strings in order to be more user safe.
sending 2 images from circulation.pl where the first is expected 
alphabetical order, imho and the second is the code without this oneline 
patch.

-- 
Henri-Damien LAURENT
BibLibre SARL
http://www.biblibre.com
Expert en Logiciels Libres pour l'info-doc
tel : +33 4 67 65 75 50


-------------- next part --------------
A non-text attachment was scrubbed...
Name: circulationorder.png
Type: image/png
Size: 11168 bytes
Desc: not available
URL: </pipermail/koha-patches/attachments/20080827/77029a41/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: circulationorderwithoutpatch.png
Type: image/png
Size: 11242 bytes
Desc: not available
URL: </pipermail/koha-patches/attachments/20080827/77029a41/attachment-0011.png>


More information about the Koha-patches mailing list