Bugzilla – Attachment 13792 Details for
Bug 9149
Patch 8823 introduces reference to non-existent function
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] [3.8.x] Bug 9149: Add missing GetAuthorizedHeading
SIGNED-OFF-38x-Bug-9149-Add-missing-GetAuthorizedH.patch (text/plain), 4.13 KB, created by
Katrin Fischer
on 2012-11-29 22:08:47 UTC
(
hide
)
Description:
[SIGNED-OFF] [3.8.x] Bug 9149: Add missing GetAuthorizedHeading
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2012-11-29 22:08:47 UTC
Size:
4.13 KB
patch
obsolete
>From 9ac1f2f84110e231a74c500bb8def88c2d8b661c Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@cpbibliography.com> >Date: Thu, 29 Nov 2012 15:11:00 -0500 >Subject: [PATCH] [SIGNED-OFF] [3.8.x] Bug 9149: Add missing > GetAuthorizedHeading > >On 3.8.x, it was possible for multiple automatically generated >authorities to be linked to a single heading. This patch deletes >previous links from headings prior to linking them to >automatically-generated headings. This patch also corrects a >potential problem wherein multiple authorities might be generated if >a record is edited repeatedly in quick succession. The latter problem >exists on Master and 3.6.x as well, and the code that corrects the >multiple linkages is equally applicable if seemingly unnecessary. > >This patch adds a missing routine to C4::AuthoritiesMarc that should >have been in the 3.8.x version of the patch for bug 8823. > >To test: >1) Turn on BiblioAddsAuthorities and AutoCreateAuthorities. >2) Create a new record or edit an existing one, and add an > authority-controlled heading (for example, MARC21 1xx or 6xx or > UNIMARC 6xx or 7xx) which does not currently exist in your authority > file. >3) If you don't get a software error, it worked. > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >For 2) you can also download a record over Z39.50. >Passes all tests. >--- > C4/AuthoritiesMarc.pm | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 63 insertions(+) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 061546e..47e39a4 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -1144,6 +1144,69 @@ sub BuildSummary { > return \%summary; > } > >+=head2 GetAuthorizedHeading >+ >+ $heading = &GetAuthorizedHeading({ record => $record, authid => $authid }) >+ >+Takes a MARC::Record object describing an authority record or an authid, and >+returns a string representation of the first authorized heading. This routine >+should be considered a temporary shim to ease the future migration of authority >+data from C4::AuthoritiesMarc to the object-oriented Koha::*::Authority. >+ >+=cut >+ >+sub GetAuthorizedHeading { >+ my $args = shift; >+ my $record; >+ unless ($record = $args->{record}) { >+ return unless $args->{authid}; >+ $record = GetAuthority($args->{authid}); >+ } >+ if (C4::Context->preference('marcflavour') eq 'UNIMARC') { >+# construct UNIMARC summary, that is quite different from MARC21 one >+# accepted form >+ foreach my $field ($record->field('2..')) { >+ return $field->as_string('abcdefghijlmnopqrstuvwxyz'); >+ } >+ } else { >+ foreach my $field ($record->field('1..')) { >+ my $tag = $field->tag(); >+ next if "152" eq $tag; >+# FIXME - 152 is not a good tag to use >+# in MARC21 -- purely local tags really ought to be >+# 9XX >+ if ($tag eq '100') { >+ return $field->as_string('abcdefghjklmnopqrstvxyz68'); >+ } elsif ($tag eq '110') { >+ return $field->as_string('abcdefghklmnoprstvxyz68'); >+ } elsif ($tag eq '111') { >+ return $field->as_string('acdefghklnpqstvxyz68'); >+ } elsif ($tag eq '130') { >+ return $field->as_string('adfghklmnoprstvxyz68'); >+ } elsif ($tag eq '148') { >+ return $field->as_string('abvxyz68'); >+ } elsif ($tag eq '150') { >+ return $field->as_string('abvxyz68'); >+ } elsif ($tag eq '151') { >+ return $field->as_string('avxyz68'); >+ } elsif ($tag eq '155') { >+ return $field->as_string('abvxyz68'); >+ } elsif ($tag eq '180') { >+ return $field->as_string('vxyz68'); >+ } elsif ($tag eq '181') { >+ return $field->as_string('vxyz68'); >+ } elsif ($tag eq '182') { >+ return $field->as_string('vxyz68'); >+ } elsif ($tag eq '185') { >+ return $field->as_string('vxyz68'); >+ } else { >+ return $field->as_string(); >+ } >+ } >+ } >+ return; >+} >+ > =head2 BuildUnimarcHierarchies > > $text= &BuildUnimarcHierarchies( $authid, $force) >-- >1.7.9.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 9149
:
13788
| 13792