Bugzilla – Attachment 67211 Details for
Bug 10132
Add option to set MarcOrgCode on branch level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10132: Simplify code, call the method only once
Bug-10132-Simplify-code-call-the-method-only-once.patch (text/plain), 1.69 KB, created by
Jonathan Druart
on 2017-09-19 13:44:37 UTC
(
hide
)
Description:
Bug 10132: Simplify code, call the method only once
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-09-19 13:44:37 UTC
Size:
1.69 KB
patch
obsolete
>From 1c300aad5d00323b951023bc7b637886dec6db4c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 19 Sep 2017 09:59:36 -0300 >Subject: [PATCH] Bug 10132: Simplify code, call the method only once > >--- > C4/AuthoritiesMarc.pm | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index ac109dee40..160ff4ad6a 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -608,15 +608,17 @@ sub AddAuthority { > if ($format eq "MARC21") { > my $userenv = C4::Context->userenv; > my $library; >+ my $marcorgcode = C4::Context->preference('MARCOrgCode'); > if ( $userenv && $userenv->{'branch'} ) { > $library = Koha::Libraries->find( $userenv->{'branch'} ); >+ $marcorgcode = $library->get_effective_marcorgcode; > } > if (!$record->leader) { > $record->leader($leader); > } > if (!$record->field('003')) { > $record->insert_fields_ordered( >- MARC::Field->new('003', $library ? $library->get_effective_marcorgcode : C4::Context->preference('MARCOrgCode')) >+ MARC::Field->new('003', $marcorgcode), > ); > } > my $date=POSIX::strftime("%y%m%d",localtime); >@@ -635,8 +637,8 @@ sub AddAuthority { > if (!$record->field('040')) { > $record->insert_fields_ordered( > MARC::Field->new('040','','', >- 'a' => $library ? $library->get_effective_marcorgcode : C4::Context->preference('MARCOrgCode'), >- 'c' => $library ? $library->get_effective_marcorgcode : C4::Context->preference('MARCOrgCode') >+ 'a' => $marcorgcode, >+ 'c' => $marcorgcode, > ) > ); > } >-- >2.11.0
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 10132
:
64183
|
64184
|
64185
|
64186
|
64187
|
67060
|
67061
|
67062
|
67063
|
67064
|
67065
|
67066
|
67067
|
67208
| 67211