Faulty label normalizers for monograph_part labels

Bug #1155313 reported by Dan Pearl
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
2.6
Fix Released
Medium
Unassigned
2.7
Fix Released
Medium
Unassigned

Bug Description

When producing a codified version of a part label into label_sortkey, the algorithm produces incorrectly formatted results which compromises the value's usefulness.

The problem results when detected values appear earlier in the string.

For example:
Label label_sortkey
DISC 15.1 | disc00000000000000000150000000001 This is not correct
DISC 15.2 | disc00000000150000000002 This is correct

Evergreen 2.4
Opensrf all
PG all
Linux all

I have a fix which I will be submitting shortly.

Tags: pullrequest
Revision history for this message
Ben Shum (bshum) wrote :

I wonder if this is related to bug 1150939. Which is the "part" in your example labels above? And what classification scheme is being employed for the volume?

Changed in evergreen:
status: New → Incomplete
Revision history for this message
Dan Pearl (dpearl) wrote :

This is related only in the conceptual sense; the code to normalize volume labels is different from that of the Dewey normalizer. The "part" can refer to an issue of a serial ("2012.10"), a disc of a multi-disk set ("Disk 2"), etc. The classification scheme is not related to this code, AFAIK.

tags: added: pullrequest
Revision history for this message
Dan Pearl (dpearl) wrote :

Here is the fix. I assume at some point these sort of things get pulled out into upgrade scripts.

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/dpearl/sortkey

Revision history for this message
Ben Shum (bshum) wrote :

Gotcha. Assigning new fix target.

Changed in evergreen:
milestone: none → 2.4.0-rc
status: Incomplete → Triaged
importance: Undecided → Medium
Ben Shum (bshum)
Changed in evergreen:
milestone: 2.4.0-rc → none
Revision history for this message
Bill Erickson (berick) wrote :

Hi Dan, actually, could you please create an upgrade script for your changes? Something along the lines of Open-ILS/src/sql/Pg/upgrade/XXXX.schema.lpad-number-repair.sql. See other files in the directory for examples. I'm happy to assist as needed.

If you're feeling adventurous, a few pgtap (Open-ILS/src/sql/Pg/t/*) tests for this function would be great, particularly since it's a small, easily tested function. This would also help demonstrate inputs and expected outputs for testers.

Revision history for this message
Dan Pearl (dpearl) wrote :

This commit ought to do it. The previous commit (see #3) addresses new installations. This is the upgrade script and includes some pgTAP tests.

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/dpearl/lpad-number-repair

Galen Charlton (gmc)
no longer affects: evergreen/2.4
Changed in evergreen:
milestone: none → 2.8-beta
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed to master, rel_2_7, and rel_2_6. Thanks, Dan!

I also included a couple follow-ups that (a) repair a copy-and-paste error in the test case and (b) update the normalized labels in biblio.monograph_parts, asset.call_number_prefix, and asset.call_number_suffix upon upgrade.

Changed in evergreen:
status: Triaged → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.