maintain_control_numbers() needs to accommodate new OCLC TCN format

Bug #1049171 reported by Jason Etheridge
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
High
Unassigned
2.2
Fix Released
Undecided
Unassigned
2.3
Fix Released
Undecided
Unassigned

Bug Description

See http://libmail.georgialibraries.org/pipermail/open-ils-dev/2012-September/008547.html

We have a section in maintain_control_numbers():

# Special handling of OCLC numbers, often found in records that lack 003
if ($cn =~ /^oc[nm]/) {
    $cn =~ s/^oc[nm]0*(\d+)/$1/;
    $record->field('003')->data('OCoLC');
    $create = 0;
}

I think we need to change it handle "on" as an OCLC prefix.

-- Jason

Tags: pullrequest
Revision history for this message
Michael Peters (mrpeters) wrote :

Thanks for opening this, Jason. We had some concerned staff this morning, too. Will look forward to a patch on down the road.

Revision history for this message
Elaine Hardy (ehardy) wrote :

Yes, thanks Jason.

Let me know if you need something formally written up. Do remember it is also a change in the number of digits, although in terms of space the entire number plus prefix the OCLC number takes up, there is no change between the ocn +9 digits and the on+ 10 digits, if I read this correctly. From the message from OCLC this morning:

Format of the OCLC Number
The OCLC Number resides in the MARC 001 field and may also be stored in other fields. The OCLC Number in the 001 field is formatted as follows:

OCLC numbers 1 through 99999999:
• “ocm” prefix
• oclc control number, 8 digits, right justified with leading zeros
• A blank space as the last character
Example: ocm00012345

OCLC numbers 100000000 to 999999999:
• “ocn” prefix
• oclc control number, 9 digits
Example: ocn123456789

OCLC numbers 1000000000 and higher:
• “on” prefix
• oclc control number, 10 or more digits
Example: on1234567890 or on1234567890123

In the 035 field, the OCLC number is usually stored with the prefix (OCoLC) and without the “ocm”, “ocn” or “on” prefixes; for example: (OCoLC)1234567890.

Changed in evergreen:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Mark Cooper (markchristophercooper) wrote :

Looking at the snippet is there more to it than this?

if ($cn =~ /^o(n|c[nm])0*(\d+)/) {
    $cn =~ s/^o(n|c[nm])0*(\d+)/$2/;
    $record->field('003')->data('OCoLC');
    $create = 0;
}

Updated in Open-ILS/src/sql/Pg/002.functions.config.sql
If not I can tell the catalogers that Evergreen is OCLC expansion ready =)

Revision history for this message
Dan Scott (denials) wrote :

Mark: That's almost identical to what I worked up - see http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/dbs/oclc13_digits - I just added the "|n" test after the "c[nm]".

tags: added: pullrequest
removed: bitesize
Revision history for this message
Mark Cooper (markchristophercooper) wrote :

It looks good and works fine for me.

Revision history for this message
Lebbeous Fogle-Weekley (lebbeous) wrote :

I have tested this and seen what I believe is the correct behavior. Thanks everyone!

Signed off, pushed to master, and backported through rel_2_2 (data moves even if software doesn't, so I think this is a bugfix).

Changed in evergreen:
status: Confirmed → Fix Committed
milestone: none → 2.4.0-alpha
Ben Shum (bshum)
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.