Bug 26866 - Items table on additem should sort by cn_sort
Summary: Items table on additem should sort by cn_sort
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Brendan Lawlor
QA Contact: Julian Maurice
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-29 16:37 UTC by Andrew Fuerste-Henry
Modified: 2024-09-10 13:45 UTC (History)
5 users (show)

See Also:
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 (2.66 KB, patch)
2024-07-22 18:17 UTC, Brendan Lawlor
Details | Diff | Splinter Review
Bug 26866: Sort items table on additem by cn_cort (2.71 KB, patch)
2024-07-22 20:09 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 26866: Sort items table on additem by cn_cort (2.77 KB, patch)
2024-07-23 13:12 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 (ashimema) 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 (lukeg) 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.