The items.cn_sort value created by the Dewey.pm does not create accurate sorting (cn_sort) values. Example 1: Three similar callnumbers do not sort the same way . Suggested fix is to replace / with spaces. (note: if any token[$i] consists of only one space when sort routine progresses it should be disregarded/removed) +--------------------------+--------------------------------+ | itemcallnumber | cn_sort | +--------------------------+--------------------------------+ | 971/P23w/v.1-2/pt.8 | 971P23WV_000000000000000_12PT_ | | 971.01/P23w/v.1-2/pt.6-7 | 971_000000000000000_01P23WV_12 | | 971.01/P23w/v.1-2/pt.7 | 971_01P23WV_12PT_7000000000000 | +--------------------------+--------------------------------+ That would improve the cn_sort values: Manually replaced '/' with spaces in items.itemcallnumber to illustrate that process. +--------------------------+--------------------------------+ | itemcallnumber | cn_sort | +--------------------------+--------------------------------+ | 971.01 P23w v.1-2 pt.6-7 | 971_010000000000000_P23W_V_12_ | | 971.01 P23w v.1-2 pt.7 | 971_010000000000000_P23W_V_12_ | | 971 P23w v.1-2 pt.8 | 971_P23W_V_12_PT_8000000000000 | +--------------------------+--------------------------------+ However, the sort routine will adjust the second 'token' it finds that is all digit. In the above case it is in the last callnumber (the 8) which is padded. A better option would be to only adjust the only adjust the second 'token' if it is the second token. Further if there are two token and the second token is not $token[2] then pad the first token with _zeros An ideal result would be: +--------------------------+--------------------------------+ | itemcallnumber | cn_sort | +--------------------------+--------------------------------+ | 971 P23w v.1-2 pt.8 | 971_000000000000000_P23W_V_12_ | | 971.01 P23w v.1-2 pt.6-7 | 971_010000000000000_P23W_V_12_ | | 971.01 P23w v.1-2 pt.7 | 971_010000000000000_P23W_V_12_ | +--------------------------+--------------------------------+ note: 30 character limit does chop the rest of the cn_sort. Without an update to the database, this will be 'collateral damage'.
Created attachment 30554 [details] [review] Bug 8837 - Dewey cn_sort inaccurate This patch fix the cn_sort sorting accurace described by Joy Nelson. Testing: I) Appy the bug 12424 patch Before applying this patch: 0) Select 3 items. 1) Edit the items selected 2) Change "Full call number" option to 971/P23w/v.1-2/pt.8, 971.01/P23w/v.1-2/pt.6-7 and 971.01/P23w/v.1-2/pt.7 3) Save changes 4) Valide 971P23WV_12PT_8_000000000000000, 971_000000000000000_01P23WV_12PT_67 and 971_01P23WV_12PT_700000000000000 (table items - cn_sort column). After applying this patch: 5) Edit again the item selected in 0 3) Save changes 4) Valide 971_000000000000000_P23W_V_12_PT_8, 971_010000000000000_P23W_V_12_PT_67, 971_010000000000000_P23W_V_12_PT_7 (table items - cn_sort column).
Created attachment 32413 [details] [review] Bug 8837 - Dewey cn_sort inaccurate I've applied the patches against master 3.17.00.027 Everything is OK, as required. So I pass the patch to "Signed Off" status.
Created attachment 32665 [details] [review] [PASSED QA] Bug 8837 - Dewey cn_sort inaccurate This patch fix the cn_sort sorting accurace described by Joy Nelson. Testing: I) Appy the bug 12424 patch Before applying this patch: 0) Select 3 items. 1) Edit the items selected 2) Change "Full call number" option to 971/P23w/v.1-2/pt.8, 971.01/P23w/v.1-2/pt.6-7 and 971.01/P23w/v.1-2/pt.7 3) Save changes 4) Valide 971P23WV_12PT_8_000000000000000, 971_000000000000000_01P23WV_12PT_67 and 971_01P23WV_12PT_700000000000000 (table items - cn_sort column). After applying this patch: 5) Edit again the item selected in 0 3) Save changes 4) Valide 971_000000000000000_P23W_V_12_PT_8, 971_010000000000000_P23W_V_12_PT_67, 971_010000000000000_P23W_V_12_PT_7 (table items - cn_sort column). Signed-off-by: Paola Rossi <paola.rossi@cineca.it> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 32666 [details] [review] [PASSED QA] Bug 8837 [QA Followup] - Add unit tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Patches pushed to master. Thanks Simith and Kyle!