Sorting of dependant fields is wrong

Jens Seidel jensseidel at users.sf.net
Mon Feb 26 01:57:41 MST 2007


On Sun, Feb 25, 2007 at 10:04:37PM -0800, Robby Stephenson wrote:
> On Sunday 25 February 2007, Jens Seidel wrote:
> > I have a dependant field which description consists of
> > %{field1}%{field2}. field1 is a number field and field2 is a text field.
> >
> > If I group entries according to this field I get the bogus order:
> > "17A" (should be 17a as I reported already)
> 
> I think I just fixed the capitalization problem, so if you want to test out 
> 1.2 branch.

Great, I will test it.
 
> > "18"
> > "4"
> > "5"
> > instead of 4, 5, 17a, 18.
> 
> This is the "sorting as text and not number" issue again, right? The only 

No, not necessarily. It depends on your internal processing. Please note
that %{field1} is a number field. So I expect a dependant field
consisting of "text1%{field1}text2%{field2}text3" to be sorted as
follows:

text1Atext2Btext3 < text1Ctext2Dtext3 := true
 if and only if
   A<C (compared numerically if field1 is a number field) or
   A=C and B<D

> thing that has occurred to me is that I could check to see if both strings 
> in the comparison start with a number, even for a text field, and then if 
> so, do a numeric comparison. That might be a bit intensive but would work 
> how you seem to expect it to. Comments?

Mmh, now that I know about dependant fields I do not know whether this
is necessary. Maybe I will find later it would nevertheless be a good
idea but currently I think the proper fix would be correct handling of
dependant fields.
 
> > Another minor issue: If I add the real number "4,5" to a text field (","
> > is the locale specific decimal separator) it is rewritten to "4, 5".
> > No space is added if I enter "4.5".
> 
> I think I got that fixed, too. It's a long leftover item from when I was 
> using a comma as the separator value.

OK. Let's hope there is no locale which uses ";" as decimal separator :-)
 
Jens



More information about the tellico-users mailing list