Bugzilla – Attachment 6498 Details for
Bug 7072
Use MARCAuthorityControlField008 to generate default 008 fields in AddAuthority
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Use MARCAuthorityControlField008 in AddAuthority for empty 008s
Use-MARCAuthorityControlField008-in-AddAuthority-f.patch (text/plain), 1.62 KB, created by
Jared Camins-Esakov
on 2011-12-01 23:25:45 UTC
(
hide
)
Description:
Use MARCAuthorityControlField008 in AddAuthority for empty 008s
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2011-12-01 23:25:45 UTC
Size:
1.62 KB
patch
obsolete
>From d170175036f42c4b2ac9e99df73b33c77acd5e00 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9rick=20Capovilla?= <frederick.capovilla@libeo.com> >Date: Thu, 20 Oct 2011 12:05:02 -0400 >Subject: [PATCH] Use MARCAuthorityControlField008 in AddAuthority for empty 008s >Content-Type: text/plain; charset="UTF-8" > >The old default value for field 008 didn't have the correct length, >which could potentially cause data corruptions. > >Uses the MARCAuthorityControlField008 preference added by BUG4839. > >http://bugs.koha-community.org/show_bug.cgi?id=7072 >Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> >--- > C4/AuthoritiesMarc.pm | 13 ++++++++++--- > 1 files changed, 10 insertions(+), 3 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index d58798d..b3c5070 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -639,9 +639,16 @@ sub AddAuthority { > } > my $date=POSIX::strftime("%y%m%d",localtime); > if (!$record->field('008')) { >- $record->insert_fields_ordered( >- MARC::Field->new('008',$date."|||a|||||| | ||| d") >- ); >+ # Get a valid default value for field 008 >+ my $default_008 = C4::Context->preference('MARCAuthorityControlField008'); >+ if(!$default_008 or length($default_008)<34) { >+ $default_008 = '|| aca||aabn | a|a d'; >+ } >+ else { >+ $default_008 = substr($default_008,0,34); >+ } >+ >+ $record->insert_fields_ordered( MARC::Field->new('008',$date.$default_008) ); > } > if (!$record->field('040')) { > $record->insert_fields_ordered( >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7072
:
6012
| 6498