Bugzilla – Attachment 122296 Details for
Bug 28491
Field 003 in authority records not updated after import
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28491: Always update field 003 in AddAuthority (MARC21)
Bug-28491-Always-update-field-003-in-AddAuthority-.patch (text/plain), 1.69 KB, created by
Hakam Almotlak
on 2021-06-22 17:02:08 UTC
(
hide
)
Description:
Bug 28491: Always update field 003 in AddAuthority (MARC21)
Filename:
MIME Type:
Creator:
Hakam Almotlak
Created:
2021-06-22 17:02:08 UTC
Size:
1.69 KB
patch
obsolete
>From f2bf1a7680f7f588e8ac8ff35d4438e5111ca04f Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 21 Jun 2021 06:59:50 +0000 >Subject: [PATCH] Bug 28491: Always update field 003 in AddAuthority (MARC21) > >Test plan: >Add or modify a record. >Verify that the 003 always become the branch or system orgcode. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/AuthoritiesMarc.pm | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 3be96dd530..2d6b72bf1a 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -556,7 +556,7 @@ sub AddAuthority { > if ($format eq "MARC21") { > my $userenv = C4::Context->userenv; > my $library; >- my $marcorgcode = C4::Context->preference('MARCOrgCode'); >+ my $marcorgcode = C4::Context->preference('MARCOrgCode') // q{}; > if ( $userenv && $userenv->{'branch'} ) { > $library = Koha::Libraries->find( $userenv->{'branch'} ); > # userenv's library could not exist because of a trick in misc/commit_file.pl (see FIXME and set_userenv statement) >@@ -565,11 +565,11 @@ sub AddAuthority { > if (!$record->leader) { > $record->leader($leader); > } >- if (!$record->field('003')) { >- $record->insert_fields_ordered( >- MARC::Field->new('003', $marcorgcode), >- ); >- } >+ >+ # Always update 003 >+ $record->delete_field( $record->field('003') ); >+ $record->insert_fields_ordered( MARC::Field->new('003', $marcorgcode) ); >+ > my $date=POSIX::strftime("%y%m%d",localtime); > if (!$record->field('008')) { > # Get a valid default value for field 008 >-- >2.25.1
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 28491
:
122209
|
122210
|
122211
|
122294
|
122295
|
122296
|
122297
|
122298
|
122299
|
122300