Bug 25897 - Inventory table call number sort should use cn_sort value
Summary: Inventory table call number sort should use cn_sort value
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low normal with 5 votes (vote)
Assignee: Katrin Fischer
QA Contact: Testopia
URL:
Keywords: Academy
Depends on: 26664
Blocks:
  Show dependency treegraph
 
Reported: 2020-06-29 21:48 UTC by Nick Clemens
Modified: 2020-11-12 09:52 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
20.11.00


Attachments
Bug 25897: Use cn_sort for sorting callnumbers in inventory table (2.28 KB, patch)
2020-10-19 00:44 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 25897: Use cn_sort for sorting callnumbers in inventory table (2.34 KB, patch)
2020-10-29 22:36 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 25897: Use cn_sort for sorting callnumbers in inventory table (2.41 KB, patch)
2020-11-03 08:13 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25897: (QA follow-up) Add filters (1.08 KB, patch)
2020-11-03 08:13 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2020-06-29 21:48:50 UTC
Given items with barcodes like: 
B 29 V55 1998
B29 .C55 2008
B29 .L24 1983
B29 .L264 1998
B29 .P666 2004

The correct sort order should be:
B29 .C55 2008
B29 .L24 1983
B29 .L264 1998
B29 .P666 2004
B 29 V55 1998

But instead it sorts in the order supplied first
Comment 1 Katrin Fischer 2020-07-18 17:58:00 UTC
Hm I thought that had been fixed by bug 19915 :(

nick, do you intend to work on this?
Comment 2 Katrin Fischer 2020-10-19 00:31:20 UTC
Can someone tell me which schema these are? Trying a fix and want to test.
Comment 3 Katrin Fischer 2020-10-19 00:39:44 UTC
I used LOC and they are sorting now as described in the example, will upload a patch.
Comment 4 Katrin Fischer 2020-10-19 00:44:31 UTC Comment hidden (obsolete)
Comment 5 Andrew Fuerste-Henry 2020-10-29 22:36:04 UTC
Created attachment 112684 [details] [review]
Bug 25897: Use cn_sort for sorting callnumbers in inventory table

Instead of using the machine sortable form of the callnumber from
cn_sort the table was only sorting on the callnumber. This tries
to fix it using the same technique as for sorting the differently
formatted dates.

To test:
- If your database has items with suitably cataloged items, use
  these. Otherwise you could use the examples from the bug report:

- Catalog items with the following barcodes:
   B 29 V55 1998
   B29 .C55 2008
   B29 .L24 1983
   B29 .L264 1998
   B29 .P666 2004
  Make sure the LOC is selected in $2 as source of classification
  This makes sure the sortable form of the callnumber is calculated
  correctly.
- Go to inventory
- Search for your items
- Before patch, they should sort on callnumber as above, after the
  patch the correct sort order should be:
   B29 .C55 2008
   B29 .L24 1983
   B29 .L264 1998
   B29 .P666 2004
   B 29 V55 1998

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 6 Martin Renvoize 2020-11-03 08:13:45 UTC
Created attachment 112892 [details] [review]
Bug 25897: Use cn_sort for sorting callnumbers in inventory table

Instead of using the machine sortable form of the callnumber from
cn_sort the table was only sorting on the callnumber. This tries
to fix it using the same technique as for sorting the differently
formatted dates.

To test:
- If your database has items with suitably cataloged items, use
  these. Otherwise you could use the examples from the bug report:

- Catalog items with the following barcodes:
   B 29 V55 1998
   B29 .C55 2008
   B29 .L24 1983
   B29 .L264 1998
   B29 .P666 2004
  Make sure the LOC is selected in $2 as source of classification
  This makes sure the sortable form of the callnumber is calculated
  correctly.
- Go to inventory
- Search for your items
- Before patch, they should sort on callnumber as above, after the
  patch the correct sort order should be:
   B29 .C55 2008
   B29 .L24 1983
   B29 .L264 1998
   B29 .P666 2004
   B 29 V55 1998

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2020-11-03 08:13:48 UTC
Created attachment 112893 [details] [review]
Bug 25897: (QA follow-up) Add filters

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2020-11-03 08:14:06 UTC
Works as expected, Passing QA
Comment 9 Jonathan Druart 2020-11-04 12:03:24 UTC
Pushed to master for 20.11, thanks to everybody involved!