Bugzilla – Attachment 147815 Details for
Bug 32279
GetAuthorizedHeading missing from exports of C4::AuthoritiesMarc
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32279: Add GetAuthorizedHeading method export C4::AuthoritiesMarc
Bug-32279-Add-GetAuthorizedHeading-method-export-C.patch (text/plain), 4.34 KB, created by
Phil Ringnalda
on 2023-03-07 03:01:41 UTC
(
hide
)
Description:
Bug 32279: Add GetAuthorizedHeading method export C4::AuthoritiesMarc
Filename:
MIME Type:
Creator:
Phil Ringnalda
Created:
2023-03-07 03:01:41 UTC
Size:
4.34 KB
patch
obsolete
>From 23e2db5a2d66420e60a0767914ac256bb7aa02ad Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Fri, 18 Nov 2022 17:36:47 -1000 >Subject: [PATCH] Bug 32279: Add GetAuthorizedHeading method export > C4::AuthoritiesMarc > >C4::AuthoritiesMarc method GetAuthorizedHeading is not exported thus it is called in other modules : > > git grep GetAuthorizedHeading >C4/AuthoritiesMarc.pm:=head2 GetAuthorizedHeading >C4/AuthoritiesMarc.pm: $heading = &GetAuthorizedHeading({ record => $record, authid => $authid }) >C4/AuthoritiesMarc.pm:sub GetAuthorizedHeading { >C4/Breeding.pm: $heading = C4::AuthoritiesMarc::GetAuthorizedHeading({ record => $marcrecord }); >C4/ImportBatch.pm: $row->{'authorized_heading'} = C4::AuthoritiesMarc::GetAuthorizedHeading( { authid => $row->{'candidate_match_id'} } ); >C4/ImportBatch.pm: my $authorized_heading = C4::AuthoritiesMarc::GetAuthorizedHeading({ record => $marc_record }); > >This patch adds it to be exported. >For example for use in Koha plugins. > >Test plan : >Check import of authorities from a file is OK > >Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> >--- > C4/AuthoritiesMarc.pm | 1 + > C4/Breeding.pm | 4 ++-- > C4/ImportBatch.pm | 6 +++--- > 3 files changed, 6 insertions(+), 5 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 0a2a736493..02f9103de3 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -53,6 +53,7 @@ BEGIN { > DelAuthority > GetAuthority > GetAuthorityXML >+ GetAuthorizedHeading > > SearchAuthorities > >diff --git a/C4/Breeding.pm b/C4/Breeding.pm >index 7b3dbc5874..7443261c62 100644 >--- a/C4/Breeding.pm >+++ b/C4/Breeding.pm >@@ -27,7 +27,7 @@ use C4::Charset qw( MarcToUTF8Record SetUTF8Flag ); > use MARC::File::USMARC; > use MARC::Field; > use C4::ImportBatch qw( GetZ3950BatchId AddBiblioToBatch AddAuthToBatch ); >-use C4::AuthoritiesMarc qw( GuessAuthTypeCode ); >+use C4::AuthoritiesMarc qw( GuessAuthTypeCode GetAuthorizedHeading ); > use C4::Languages; > use Koha::Database; > use Koha::XSLT::Base; >@@ -593,7 +593,7 @@ sub Z3950SearchAuth { > $heading_authtype_code = GuessAuthTypeCode($marcrecord); > next if ( not defined $heading_authtype_code ) ; > >- $heading = C4::AuthoritiesMarc::GetAuthorizedHeading({ record => $marcrecord }); >+ $heading = GetAuthorizedHeading({ record => $marcrecord }); > > my $breedingid = ImportBreedingAuth( $marcrecord, $serverhost[$k], $encoding[$k], $heading ); > my %row_data; >diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm >index 0956ef5f6b..8e8bb31b2c 100644 >--- a/C4/ImportBatch.pm >+++ b/C4/ImportBatch.pm >@@ -32,7 +32,7 @@ use C4::Biblio qw( > ); > use C4::Items qw( AddItemFromMarc ModItemFromMarc ); > use C4::Charset qw( MarcToUTF8Record SetUTF8Flag StripNonXmlChars ); >-use C4::AuthoritiesMarc qw( AddAuthority GuessAuthTypeCode GetAuthorityXML ModAuthority DelAuthority ); >+use C4::AuthoritiesMarc qw( AddAuthority GuessAuthTypeCode GetAuthorityXML ModAuthority DelAuthority GetAuthorizedHeading ); > use C4::MarcModificationTemplates qw( ModifyRecordWithTemplate ); > use Koha::Items; > use Koha::SearchEngine; >@@ -1494,7 +1494,7 @@ sub GetImportRecordMatches { > $sth->execute(); > while (my $row = $sth->fetchrow_hashref) { > if ($row->{'record_type'} eq 'auth') { >- $row->{'authorized_heading'} = C4::AuthoritiesMarc::GetAuthorizedHeading( { authid => $row->{'candidate_match_id'} } ); >+ $row->{'authorized_heading'} = GetAuthorizedHeading( { authid => $row->{'candidate_match_id'} } ); > } > next if ($row->{'record_type'} eq 'biblio' && not $row->{'biblionumber'}); > push @$results, $row; >@@ -1661,7 +1661,7 @@ sub _add_auth_fields { > if ($marc_record->field('001')) { > $controlnumber = $marc_record->field('001')->data(); > } >- my $authorized_heading = C4::AuthoritiesMarc::GetAuthorizedHeading({ record => $marc_record }); >+ my $authorized_heading = GetAuthorizedHeading({ record => $marc_record }); > my $dbh = C4::Context->dbh; > my $sth = $dbh->prepare("INSERT INTO import_auths (import_record_id, control_number, authorized_heading) VALUES (?, ?, ?)"); > $sth->execute($import_record_id, $controlnumber, $authorized_heading); >-- >2.26.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 32279
:
144085
|
147815
|
148836