Bug 9370 - use Library::CallNumber::LC when splitting LC call numbers for spine labels
Summary: use Library::CallNumber::LC when splitting LC call numbers for spine labels
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Galen Charlton
QA Contact:
URL:
Keywords:
Depends on: 6281
Blocks: 2500
  Show dependency treegraph
 
Reported: 2013-01-09 01:57 UTC by Galen Charlton
Modified: 2015-11-23 16:49 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
bug 9370: test case for splitting LC call number (924 bytes, patch)
2013-01-09 02:52 UTC, Galen Charlton
Details | Diff | Splinter Review
bug 9370: add invalid call number to LC splitting test cases (997 bytes, patch)
2013-01-09 02:53 UTC, Galen Charlton
Details | Diff | Splinter Review
bug 9370: improve splitting of LC call numbers for labels (2.11 KB, patch)
2013-01-09 02:53 UTC, Galen Charlton
Details | Diff | Splinter Review
bug 9370: test case for splitting LC call number (979 bytes, patch)
2013-02-15 12:40 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
bug 9370: add invalid call number to LC splitting test cases (1.03 KB, patch)
2013-02-15 12:40 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
bug 9370: improve splitting of LC call numbers for labels (2.16 KB, patch)
2013-02-15 12:40 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
bug 9370: test case for splitting LC call number (1.05 KB, patch)
2013-06-12 09:46 UTC, Chris Cormack
Details | Diff | Splinter Review
bug 9370: add invalid call number to LC splitting test cases (1.12 KB, patch)
2013-06-12 09:46 UTC, Chris Cormack
Details | Diff | Splinter Review
bug 9370: improve splitting of LC call numbers for labels (2.22 KB, patch)
2013-06-12 09:46 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Galen Charlton 2013-01-09 01:57:25 UTC
We should switch to using Library::CallNumber::LC for splitting LC call numbers when generating spine labels for several reasons:

[1] Library::CallNumber::LC was written specifically for parsing LC call numbers, while the current code in Koha was developed based on very few examples.
[2] The module is currently being used by Evergreen.  Any future efforts to improve LC call number parsing by updating Library::CallNumber::LC would benefit both ILS projects.
[3] In bug 6281, I'm proposing using this module to improve sorting of LC call numbers.  Using the module would reduce redundancy in Koha's code base.
[4] And, perhaps most importantly, it solves a problem reported by a library.

The immediate motivation for this change is an example call number that one of our customers noted is being split incorrectly.  The LC number 'QH541.15.C6 C25 2012' is currently being split like this:

QH
541
.15
.C6
C25
2012

It should actually be split as follows:
    
QH
541.15
.C6
C25
2012

The ".15" after "541" is part of the main class number; it isn't a Cutter.

To test:

[1] Add an item record with the call number QH541.15.C6 C25 2012 and set it classification source to lcc.
[2] Generate a spine label and verify that the call number is split like this:

QH
541.15
.C6
C25
2012
Comment 1 Galen Charlton 2013-01-09 02:52:22 UTC Comment hidden (obsolete)
Comment 2 Galen Charlton 2013-01-09 02:53:09 UTC Comment hidden (obsolete)
Comment 3 Galen Charlton 2013-01-09 02:53:12 UTC Comment hidden (obsolete)
Comment 4 Galen Charlton 2013-01-09 02:53:55 UTC
Note that the three patches for this bug require installing the patches for bug 6281.
Comment 5 Kyle M Hall (khall) 2013-02-15 12:40:17 UTC Comment hidden (obsolete)
Comment 6 Kyle M Hall (khall) 2013-02-15 12:40:26 UTC Comment hidden (obsolete)
Comment 7 Kyle M Hall (khall) 2013-02-15 12:40:33 UTC Comment hidden (obsolete)
Comment 8 Galen Charlton 2013-05-24 17:16:58 UTC
Just noting that as of today, the patch series still applies cleanly.
Comment 9 Jonathan Druart 2013-05-30 13:25:53 UTC
(In reply to comment #8)
> Just noting that as of today, the patch series still applies cleanly.

Galen, yes but they depend on bug 6281 which fails qa.
Comment 10 Chris Cormack 2013-06-12 09:39:52 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > Just noting that as of today, the patch series still applies cleanly.
> 
> Galen, yes but they depend on bug 6281 which fails qa.

Its now in master, so QAing this now
Comment 11 Chris Cormack 2013-06-12 09:46:25 UTC
Created attachment 18865 [details] [review]
bug 9370: test case for splitting LC call number

QH541.15.C6 C25 2012 should be split as follows:

QH
541.15
.C6
C25
2012

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

http://bugs.koha-community.org/show_bug.cgi?id=9730
Comment 12 Chris Cormack 2013-06-12 09:46:38 UTC
Created attachment 18866 [details] [review]
bug 9370: add invalid call number to LC splitting test cases

'123 ABC FOO BAR' is intentionally *not* a valid LC call number,
but in order to preserve legacy behavior, it should be split on
whitespace.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

http://bugs.koha-community.org/show_bug.cgi?id=9730
Comment 13 Chris Cormack 2013-06-12 09:46:53 UTC
Created attachment 18867 [details] [review]
bug 9370: improve splitting of LC call numbers for labels

Use the Perl module Library::CallNumber::LC to parse and split
LC call numbers when generating spine labels.

For example, QH541.15.C6 C25 2012 should be split as follows:

QH
541.15
.C6
C25
2012

To test, create an item with call number QH541.15.C6 C25 2012
and classification source LC, then create a spine label for that
item using a layout of type 'biblio' that has the split call numbers
option enabled.  The call number should be split as indicated above.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Comment 14 Galen Charlton 2013-06-12 14:45:08 UTC
Pushed to master.
Comment 15 Tomás Cohen Arazi (tcohen) 2013-06-28 15:18:38 UTC
This patch has been pushed to 3.12.x, will be in 3.12.2.

I'm not sure why marking it enh instead of normal.
Thanks Galen!
Comment 16 Bernardo Gonzalez Kriegel 2013-07-13 12:07:45 UTC
Pushed to 3.10.x, will be in 3.10.8
Comment 17 Chris Hall 2013-07-17 08:15:10 UTC
Pushed to 3.8.x, will be in 3.8.15