Bugzilla – Attachment 185030 Details for
Bug 40578
C4/Heading/UNIMARC.pm does deal with authorities
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40578: C4/Heading/UNIMARC.pm does deal with authorities
Bug-40578-C4HeadingUNIMARCpm-does-deal-with-author.patch (text/plain), 2.36 KB, created by
Baptiste Wojtkowski (bwoj)
on 2025-08-01 14:23:13 UTC
(
hide
)
Description:
Bug 40578: C4/Heading/UNIMARC.pm does deal with authorities
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2025-08-01 14:23:13 UTC
Size:
2.36 KB
patch
obsolete
>From 8151a1fc9126b93b7dc3d47b3bdeebda1439e425 Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Fri, 1 Aug 2025 16:06:30 +0200 >Subject: [PATCH] Bug 40578: C4/Heading/UNIMARC.pm does deal with authorities > >TEST PLAN ON AN UNIMARC INSTANCE: >1 - Run tests, they don't work >2 - Run test plan of BZ30047 >3 - Run tests, they now work >--- > C4/Heading/UNIMARC.pm | 34 +++++++++++++++++++++++++++++----- > 1 file changed, 29 insertions(+), 5 deletions(-) > >diff --git a/C4/Heading/UNIMARC.pm b/C4/Heading/UNIMARC.pm >index 1021f06aa..c5ed5c573 100644 >--- a/C4/Heading/UNIMARC.pm >+++ b/C4/Heading/UNIMARC.pm >@@ -55,6 +55,7 @@ my %subdivisions = ( > ); > > my $bib_heading_fields; >+my $auth_heading_fields; > > =head1 METHODS > >@@ -84,6 +85,23 @@ sub new { > } > } > >+ unless ( defined $auth_heading_fields ) { >+ my $dbh = C4::Context->dbh; >+ my $sth = $dbh->prepare( >+ "SELECT tagfield, authtypecode >+ FROM auth_tag_structure >+ WHERE authtypecode <> ''" >+ ); >+ $sth->execute(); >+ $auth_heading_fields = {}; >+ while ( my ( $tag, $auth_type ) = $sth->fetchrow ) { >+ $auth_heading_fields->{$tag} = { >+ auth_type => $auth_type, >+ subfields => 'abcdefghjklmnopqrstvxyz', >+ }; >+ } >+ } >+ > return bless {}, $class; > } > >@@ -92,8 +110,12 @@ sub new { > =cut > > sub valid_heading_tag { >- my ( $self, $tag ) = @_; >- return $bib_heading_fields->{$tag}; >+ my ( $self, $tag, $frameworkcode, $auth ) = @_; >+ unless ($auth) { >+ return $bib_heading_fields->{$tag}; >+ } else { >+ return $auth_heading_fields->{$tag}; >+ } > } > > =head2 valid_heading_subfield >@@ -116,10 +138,12 @@ sub valid_heading_subfield { > =cut > > sub parse_heading { >- my ( $self, $field ) = @_; >+ my ( $self, $field, $auth ) = @_; >+ >+ my $tag = $field->tag; >+ my $heading_fields = $auth ? {%$auth_heading_fields} : {%$bib_heading_fields}; >+ my $field_info = $heading_fields->{$tag}; > >- my $tag = $field->tag; >- my $field_info = $bib_heading_fields->{$tag}; > my $auth_type = $field_info->{'auth_type'}; > my $search_heading = _get_search_heading( $field, $field_info->{'subfields'} ); > my $display_heading = _get_display_heading( $field, $field_info->{'subfields'} ); >-- >2.30.2
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 40578
: 185030