Dewey sorting not quite right

Bug #902667 reported by James Fournie
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Status tracked in Main
2.0
Fix Released
Medium
Unassigned
2.1
Fix Released
Medium
Unassigned
Main
Fix Released
Medium
Unassigned

Bug Description

Evergreen: 2.0 (bug exists through to master)
Postgres: 8.4

Dewey sorting doesn't sort dewey numbers without decimals properly, for example:

520.2 Dic
520.222 Dic
520.92 Sob
520 Ber
520 Dic

If it's not obvious -- 520 should be before 520.2

We can see in the database, the label_sortkey values are not correctly padded:

36037509 | 520.2 Dic | 520_200000000000000_DIC
 36050809 | 520.222 Dic | 520_222000000000000_DIC
 36051822 | 520.92 Sob | 520_920000000000000_SOB
 36038062 | 520 Ber | 520_BER
 36038615 | 520 Dic | 520_DIC

This is resolved by this Koha commit: http://git.koha-community.org/gitweb/?p=koha.git;a=commitdiff;h=aef8358c

I have (side? cross?) ported this to Evergreen, there is a branch:
working/user/jamesrf/lp902667-dewey-sort-fix

A database upgrade number needs to be assigned.

Tags: pullrequest
James Fournie (jfournie)
description: updated
tags: added: pullrequest
description: updated
description: updated
Ben Shum (bshum)
Changed in evergreen:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Ben Shum (bshum) wrote :

Confirming James' observation in our 2.0 systems. Will test out the proposed update early next week.

Revision history for this message
Ben Shum (bshum) wrote :

Comment about the attribution in the SQL portions... Since we're deriving from the patch written by Magnus Enger for Koha, does Liblime have to be mentioned at all? I asked about this to some Koha devs and they suggested that we could drop that explicit mention since we're noting the derived source already. Alternatively, consider something like "Koha Development Team" as the original source copyright since that's what the HEAD is set to in the file too. While investigating this, I can see that there's precedent for inclusion from other parts of the file though, so maybe not an issue?

Otherwise, the patch applied easily to our 2.0 test system and started churning out better entries for the label_sortkey. Thanks James!

Revision history for this message
Dan Scott (denials) wrote :

Ben: re: copyright attribution, the mention of LibLime stems back to the original version of the function committed to Evergreen, which was derived from the Koha file in question, which does include the LibLime copyright statement. We're simply maintaining that copyright attribution, in compliance with the terms of the GPL v2.

The Koha file has an AUTHORS section at the very bottom which mentions the Koha Development Team, but it's not a copyright statement. By pointing from our commit message to the corresponding commit in the Koha community repository, I believe we're respecting the provenance of the code, while also maintaining the existing copyright notice.

In any case, I have committed James' fix and a numbered upgrade script from master through rel_2_0.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.