Bug 26866

Summary: Items table on additem should sort by cn_sort
Product: Koha Reporter: Andrew Fuerste-Henry <andrewfh>
Component: Staff interfaceAssignee: Brendan Lawlor <blawlor>
Status: Needs documenting --- QA Contact: Julian Maurice <julian.maurice>
Severity: major    
Priority: P5 - low CC: blawlor, fridolin.somers, gmcharlt, julian.maurice, lucas
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25897
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00,24.05.04
Circulation function:
Attachments: Bug 26866: Sort items table on additem by cn_cort
Bug 26866: Sort items table on additem by cn_cort
Bug 26866: Sort items table on additem by cn_cort

Description Andrew Fuerste-Henry 2020-10-29 16:37:08 UTC
To recreate:
- create a bib
- add three items with source of classification LCC, call numbers:
-- JC43 .G6 1890
-- JC330 .F74 2000
-- JC480 .R63 2006
- on additem.pl, sort the items table by "Full call number"
- notice items are order incorrectly, going 330, 43, 480
- use a report to pull the cn_sort values for your 3 items, confirm that ordering by cn_sort in your report correctly orders them 43, 330, 480

We should use cn_sort here to get them in the correct order.
Comment 1 Katrin Fischer 2020-10-29 22:13:49 UTC
Andrew, could you test bug 25897 maybe? If that solution works well, we might be able to apply it in other places.
Comment 2 Andrew Fuerste-Henry 2020-10-29 22:36:49 UTC
Happy to! It worked!
Comment 3 Katrin Fischer 2020-11-01 00:47:21 UTC
Thx, Andrew!
Comment 4 Brendan Lawlor 2024-07-22 18:17:15 UTC
Created attachment 169336 [details] [review]
Bug 26866: Sort items table on additem by cn_cort

This patch changes the data-order attribute for the item callnumber column
to use the item's cn_sort instead of the callnumber value.

Test plan:
1. Create a bib
2. Add three items with source of classification LLC
    call numbers:
    JC43 .G6 1890
    JC330 .F74 2000
    JC480 .R63 2006
4. On additem.pl sor the items table by 'Full call number'
5. Confirm the items are now ordered correctly by cn_sort
6. Confirm the other columns still sort correctly
Comment 5 Roman Dolny 2024-07-22 20:09:50 UTC
Created attachment 169381 [details] [review]
Bug 26866: Sort items table on additem by cn_cort

This patch changes the data-order attribute for the item callnumber column
to use the item's cn_sort instead of the callnumber value.

Test plan:
1. Create a bib
2. Add three items with source of classification LLC
    call numbers:
    JC43 .G6 1890
    JC330 .F74 2000
    JC480 .R63 2006
4. On additem.pl sor the items table by 'Full call number'
5. Confirm the items are now ordered correctly by cn_sort
6. Confirm the other columns still sort correctly

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 6 Julian Maurice 2024-07-23 13:00:21 UTC
Major bug, really ? :)
Starting QA review
Comment 7 Julian Maurice 2024-07-23 13:12:21 UTC
Created attachment 169419 [details] [review]
Bug 26866: Sort items table on additem by cn_cort

This patch changes the data-order attribute for the item callnumber column
to use the item's cn_sort instead of the callnumber value.

Test plan:
1. Create a bib
2. Add three items with source of classification LLC
    call numbers:
    JC43 .G6 1890
    JC330 .F74 2000
    JC480 .R63 2006
4. On additem.pl sor the items table by 'Full call number'
5. Confirm the items are now ordered correctly by cn_sort
6. Confirm the other columns still sort correctly

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 8 Brendan Lawlor 2024-07-23 13:24:09 UTC
(In reply to Julian Maurice from comment #6)
> Major bug, really ? :)
> Starting QA review

majorly old :) Thanks Julian!
Comment 9 Martin Renvoize 2024-07-23 15:05:07 UTC
Thanks for all the hard work!

Pushed to main for the next 24.11.00 release as RM Assistant
Comment 10 Lucas Gass 2024-08-28 20:08:42 UTC
Backported to 24.05.x for upcoming 24.05.04
Comment 11 Fridolin Somers 2024-09-10 13:44:52 UTC
In case items.cn_sort is empty we should falback to items.itemcallnumber no ?

I prefer not backport to 23.11.x to be stable in behavior.