Koha-clms/C4
Jason Etheridge e311ea1308 Bug 9770: fix sorting of Dewey call numbers that contain prefixes
C4::ClassSortRoutine::Dewey can pad the wrong part of a call number internally.

The subroutine get_class_sort_key tokenizes a call number string (splitting on
periods and whitespace) and counts the number of tokens that solely contain
digits.  If there is only one such digit group, a comment in the code states
that it will pad said digit group.  However, the bug is that the code assumes
said digit group is the first token, when this may not be the case.

In practice, this can cause poor sorting when used a call number is in the form
of PREFIX _space_ 3DIGITS.

To test:

[1] Create two item records whose class scheme is set to
    'ddc' (Dewey) and whose call numbers contain prefixes, e.g.,
    J DVD 700.1 ABC and J DVD 850 DEF.
[2] Use the inventory tool to produce a list of item items that include
    the two created in step 1.  Obsere that that items are sorted
    in the incorrect order, with "J DVD 850 DEF" coming before
    "J DVD 700.1 ABC".  Alternatively, run the following SQL
    to see the incorrect sort order:

    SELECT cn_sort, itemcallnumber
    FROM items
    WHERE itemcallnumber LIKE 'J DVD%'
    ORDER BY cn_sort;

[4] Apply this patch.
[5] Run misc/maintenance/touch_all_items.pl to force cn_sort to be
    recalculated.
[6] Repeat step 2 and verify that the call numbers are now sorted
    corrected.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit dba36a7a12)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit f05642589d)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit f05642589d)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit 404a931efa)
2013-08-20 21:15:45 +12:00
..
AuthoritiesMarc Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Barcodes Bug 8524 follow-up: fix Javascript syntax error 2012-09-14 08:58:28 +12:00
Cache Bug 5385: POD Cleanups (part 1) 2010-11-12 10:06:55 +13:00
ClassSortRoutine Bug 9770: fix sorting of Dewey call numbers that contain prefixes 2013-08-20 21:15:45 +12:00
Creators Bug 9535 - Patron card creator "Remove duplicates" function doesn't work 2013-04-14 19:26:56 +12:00
External Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Form Fix for Bug 6458 - incorrect parsing result in translation processing 2011-09-15 08:38:58 +12:00
Heading Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
ILSDI Bug 9019: Return item fields in ILS-DI GetRecords 2013-04-24 21:12:51 +12:00
Installer bug 6281: add Library::CallNumber::LC as a required Perl dependency 2013-07-17 19:54:34 +12:00
Labels bug 9370: improve splitting of LC call numbers for labels 2013-07-17 20:14:34 +12:00
Linker Bug 8447: Make sure we have enough subfields for broader_headings 2012-09-16 08:18:58 +12:00
Members Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
OAI Bug 6440: Implement OAI-PMH Sets 2012-03-20 11:38:26 +01:00
Output Fix FSF address in directory C4/ 2010-03-16 20:17:56 -04:00
Patroncards Bug 8315 - remove use C4::* version 2012-07-14 10:26:07 +12:00
Reports Bug 8594 - prevent the report system from breaking some subqueries 2012-09-06 11:05:15 +12:00
SIP Bug 9838: fix on 04patron_status.t 2013-04-14 18:15:14 +12:00
Search Bug 5385: POD Cleanups (part 1) 2010-11-12 10:06:55 +13:00
Utils Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
VirtualShelves Bug 10466: fix glitch in OPAC display of titles saved to list 2013-07-18 21:00:17 +12:00
Accounts.pm Bug 8739 follow-up fixing perlcritic error 2012-10-04 08:34:38 +13:00
Acquisition.pm Bug 10381: POD lines of GetBasketsInfosByBookseller 2013-06-17 19:52:42 +12:00
Auth.pm do some validation of the KohaOpacRecentSearches cookie 2013-07-28 03:16:57 +00:00
Auth_cas_servers.yaml.orig Bug 5630 CAS improvements 2011-10-13 10:49:49 +13:00
Auth_with_cas.pm Bug 10029 - CAS authentication fails in OPAC reserve 2013-08-18 11:09:29 +12:00
Auth_with_ldap.pm Bug 10384: fall back to normal authentication if LDAP server is not available 2013-08-18 16:32:41 +12:00
AuthoritiesMarc.pm Bug 9123: Authorities search ordered by authid does not work 2012-12-03 20:00:51 +13:00
BackgroundJob.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Barcodes.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Biblio.pm Bug 9147: OPAC hidden fields are not hidden in ISBD view 2013-02-01 21:00:43 +13:00
Bookseller.pm Bug 8223 - Properly format SQL query in C4::Bookseller::GetBookSeller 2012-06-22 14:17:59 +12:00
Boolean.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Branch.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Breeding.pm Bug 8350: warning in logs when searching for nonexistent ISBN 2012-10-04 08:06:50 +13:00
Budgets.pm Bug 10535: by default sort funds by name 2013-08-18 16:50:01 +12:00
Cache.pm Bug 5363 - Removing unused module (C4::Cache::FastMemcached) 2010-11-04 20:05:36 +13:00
Calendar.pm Bug 7477: Followup: Fix perlcritic issues 2012-03-19 18:16:40 +01:00
Category.pm Bug 4330 : Adding copyright headers and fixing FSF addresses 2012-05-29 16:52:19 +12:00
Charset.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Circulation.pm Bug 8800 - useDaysMode=Datedue wrong behaviour (revisited) 2012-11-26 13:22:56 +13:00
ClassSortRoutine.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
ClassSource.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Context.pm Bug 9085 - Installer will not run with DEBUG set 2012-11-21 08:42:12 +13:00
Contract.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Creators.pm Bug 8315 - remove use C4::* version 2012-07-14 10:26:07 +12:00
Csv.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Dates.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Debug.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Heading.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Images.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
ImportBatch.pm Bug 7329 [Followup] : when reverting an import, keep matching biblionumber in batch table, if items are not deleted because they are issued. 2012-06-20 21:01:02 +12:00
ImportExportFramework.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Input.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Installer.pm Bug 8315 - remove use C4::* version 2012-07-14 10:26:07 +12:00
ItemCirculationAlertPreference.pm Bug 4330 : Adding copyright headers and fixing FSF addresses 2012-05-29 16:52:19 +12:00
ItemType.pm Bug 4330 : Adding copyright headers and fixing FSF addresses 2012-05-29 16:52:19 +12:00
Items.pm Bug 10088: FIX adding an order from a staged file. 2013-08-18 16:30:52 +12:00
Koha.pm Bug 9341: Problem with UNIMARC authors facets 2013-03-29 19:10:36 +13:00
Labels.pm Bug 8315 - remove use C4::* version 2012-07-14 10:26:07 +12:00
Languages.pm Bug 8954: Make languages list in advanced search translatable (revision 1) 2012-11-26 13:19:24 +13:00
Letters.pm Bug 9348 - Format dates in HOLD notices consistently 2013-02-01 21:11:28 +13:00
Linker.pm Bug 7284: Fix unit test broken by erroneous POD 2012-03-08 15:24:18 +01:00
Log.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Maintainance.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Matcher.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Members.pm Bug 8682 - Renewals do not appear on quick slips 2013-03-11 21:46:59 +13:00
Message.pm Bug 4330 : Adding copyright headers and fixing FSF addresses 2012-05-29 16:52:19 +12:00
NewsChannels.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Output.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Overdues.pm Bug 8939 : Fines being charged during the grace period 2012-10-27 14:30:46 +13:00
Patroncards.pm Bug 8315 - remove use C4::* version 2012-07-14 10:26:07 +12:00
Print.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Ratings.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Record.pm Bug 9274: Software error in bibtex export 2013-03-31 18:53:57 +13:00
Reports.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Reserves.pm Bug 8700 - RESERVESLIP fields not being replaced correctly 2012-10-11 10:32:37 +13:00
Review.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Ris.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
RotatingCollections.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
SMS.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
SQLHelper.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Scheduler.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Scrubber.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Search.pm Bug 9377 - itemtype in duplicate biblio search 2013-03-17 09:24:49 +13:00
Serials.pm Bug 6655 - Sorting order of serial issues in OPAC 2012-08-03 09:24:48 +12:00
Service.pm POD Cleanups 2010-06-09 08:38:59 -04:00
ShelfBrowser.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
SocialData.pm bug 7470 follow-up, fix POD doc 2012-03-26 17:53:28 +02:00
Stats.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Suggestions.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
TTParser.pm Bug 5327 : Follow up for TTParser test 2012-07-07 11:35:47 +12:00
Tags.pm Bug 7642: Fixing typo 2012-10-02 11:26:19 +13:00
Templates.pm Bug 10560: make it possible for default interface language to not be English 2013-08-18 16:51:40 +12:00
TmplToken.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
TmplTokenType.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
UploadedFile.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
Utils.pm Bug 7941 : Module versions bumped pre release 2012-06-14 19:19:50 +12:00
VirtualShelves.pm Bug 10386: improvements to VirtualShelves.t 2013-08-18 10:58:14 +12:00
XISBN.pm Bug 9726: XISBN service throttle not initialized 2013-03-31 19:40:16 +13:00
XSLT.pm Bug 6886 - OPAC XSLT respecting single branch mode 2012-09-06 11:14:41 +12:00