[Koha-bugs] [Bug 13420] sorting on volume number is not sorting right

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Feb 11 15:17:07 CET 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13420

Kyle M Hall <kyle at bywatersolutions.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kyle at bywatersolutions.com

--- Comment #7 from Kyle M Hall <kyle at bywatersolutions.com> ---
This issue is that the volume column is being sorted as a string, rather than a
number. This does and does not make sense. The volume field is not strictly a
number, but is a general text field. Some libraries may put "123" in there, or
"vol 123" or as is the case for Karl, "v. 123".

The quick hack solution would be to pad out all the volume numbers to the same
length in the volume field itself. This is a very sub-optimal solution.

I think the optimal solution would be to take each volume field and pad out
each number in the string to 10 or so digits. We can then take the padded
version and put it in a hidden column that is used for sorting the visible
column.

The regex s/([0-9]+)/sprintf('%010d',$1)/ge; should take care of the padding.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list