Bugzilla – Attachment 188210 Details for
Bug 20153
Add new column "source" in the authorities pages's result
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20153: (QA follow-up) Fix tidiness
Bug-20153-QA-follow-up-Fix-tidiness.patch (text/plain), 3.25 KB, created by
Lari Taskula
on 2025-10-21 10:13:59 UTC
(
hide
)
Description:
Bug 20153: (QA follow-up) Fix tidiness
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2025-10-21 10:13:59 UTC
Size:
3.25 KB
patch
obsolete
>From d44adc6147055534ac9483ea0fb97b0402b24c52 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Tue, 21 Oct 2025 12:39:25 +0300 >Subject: [PATCH] Bug 20153: (QA follow-up) Fix tidiness > >--- > C4/AuthoritiesMarc.pm | 26 ++++++++++++++--------- > Koha/SearchEngine/Elasticsearch/Search.pm | 3 ++- > 2 files changed, 18 insertions(+), 11 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index d7c61e7e7f7..759c5355106 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -705,7 +705,7 @@ sub AddAuthority { > > my $heading = $authority->heading_object( { record => $record } ); > >- my $origincode = CalculateOriginCode($record, $authtypecode); >+ my $origincode = CalculateOriginCode( $record, $authtypecode ); > > # Update > $authority->update( >@@ -1284,19 +1284,25 @@ sub GetAuthorizedHeading { > =cut > > sub CalculateOriginCode { >- my ($record, $authtypecode) = @_; >+ my ( $record, $authtypecode ) = @_; > >- my ($tagfield, $tagsubfield) = GetAuthMARCFromKohaField('auth_header.origincode', $authtypecode); >- if (not(defined($tagfield) && defined($tagsubfield)) || not($record->subfield($tagfield, $tagsubfield))) { >- if (C4::Context->preference('marcflavour') eq 'MARC21') { >- return $record->subfield('040', 'c') || $record->subfield('040', 'a') || $record->subfield('024', '2') || $record->field('003') || ''; >- } >- else { >- warn "KohaToMARCMapping for 'auth_header.origincode' not set for '".C4::Context->preference('marcflavour')."' and don't know what fallbacks to use."; >+ my ( $tagfield, $tagsubfield ) = GetAuthMARCFromKohaField( 'auth_header.origincode', $authtypecode ); >+ if ( not( defined($tagfield) && defined($tagsubfield) ) || not( $record->subfield( $tagfield, $tagsubfield ) ) ) { >+ if ( C4::Context->preference('marcflavour') eq 'MARC21' ) { >+ return >+ $record->subfield( '040', 'c' ) >+ || $record->subfield( '040', 'a' ) >+ || $record->subfield( '024', '2' ) >+ || $record->field('003') >+ || ''; >+ } else { >+ warn "KohaToMARCMapping for 'auth_header.origincode' not set for '" >+ . C4::Context->preference('marcflavour') >+ . "' and don't know what fallbacks to use."; > return ''; > } > } >- return $record->subfield($tagfield, $tagsubfield); >+ return $record->subfield( $tagfield, $tagsubfield ); > } > > =head2 CompareFieldWithAuthority >diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm >index 17de68247a0..b35b208c596 100644 >--- a/Koha/SearchEngine/Elasticsearch/Search.pm >+++ b/Koha/SearchEngine/Elasticsearch/Search.pm >@@ -260,7 +260,8 @@ sub search_auth_compat { > # Turn the resultset into a hash > $result{authtype} = $authtype ? $authtype->authtypetext : $authtypecode; > $result{reported_tag} = $reported_tag; >- $result{origincode} = C4::AuthoritiesMarc::CalculateOriginCode($marc, $authtypecode); >+ $result{origincode} = C4::AuthoritiesMarc::CalculateOriginCode( $marc, $authtypecode ); >+ > > if ( C4::Context->preference('ShowHeadingUse') ) { > >-- >2.34.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 20153
:
171569
|
188205
|
188206
|
188208
|
188209
| 188210