Bugzilla – Attachment 174897 Details for
Bug 38494
Koha should consider authority heading use in cataloging
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38494: Koha should consider authority heading use in cataloging
Bug-38494-Koha-should-consider-authority-heading-u.patch (text/plain), 4.18 KB, created by
Janusz Kaczmarek
on 2024-11-21 16:41:15 UTC
(
hide
)
Description:
Bug 38494: Koha should consider authority heading use in cataloging
Filename:
MIME Type:
Creator:
Janusz Kaczmarek
Created:
2024-11-21 16:41:15 UTC
Size:
4.18 KB
patch
obsolete
>From d8fd73bee24b156f5bfe745f71ba3707b8248a7a Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Wed, 20 Nov 2024 13:18:05 +0000 >Subject: [PATCH] Bug 38494: Koha should consider authority heading use in > cataloging >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >In MARC 21 authority records, three bytes (008/14-16) indicate what the >heading can be used for (main/added entry, subject entry, series entry). >Koha should be able to respect the record's intended use in authority >search during cataloging, provided that the authority file is well >formed. Also, we should be able to decide between more strict but >correct behavior and current lax behavior. > >Test plan: >---------- >1. Apply the patch; updatedatabase ; restart_all >2. Set the ShowHeadingUse system preference to âShowâ >3. Go to the Cataloging editor and open the authority finder plugin for > the 100 field. Search for Peter. With standard ktd test data you should > get 9 results, some with âvâ before Main/Added Entry, some with âxâ. > These with âxâ are not to be used in this context, provided you use a > well-formed authority file >4. Set ConsiderHeadingUse system preference to âDoâ >5. Repeat p. 3. You should get now only 4 Peters â those with âvâ > before Main/Added Entry (008/14 = âaâ) >6. You can repeat the test for subject headings (6XX) and series > headings (sometimes you would have to modify the test data, e.g. there > are few authority records with 008/16 = âaâ (series use) >7. This should work equally with Zebra and with Elasticsearch > >Sponsored-by: Ignatianum University in Cracow >--- > authorities/auth_finder.pl | 19 +++++++++++++++++++ > .../bug_38494-ConsiderHeadingUse_syspref.pl | 2 +- > 2 files changed, 20 insertions(+), 1 deletion(-) > >diff --git a/authorities/auth_finder.pl b/authorities/auth_finder.pl >index 1603fbbc31..819b59f75f 100755 >--- a/authorities/auth_finder.pl >+++ b/authorities/auth_finder.pl >@@ -68,6 +68,25 @@ if ( $op eq "do_search" ) { > my $startfrom = $query->param('startfrom') || 0; > my $resultsperpage = $query->param('resultsperpage') || 20; > >+ if ( C4::Context->preference('ConsiderHeadingUse') ) { >+ my $marcflavour = C4::Context->preference('marcflavour'); >+ my $biblio_tag = substr( $index, 4, 3 ); >+ if ( $marcflavour eq 'MARC21' ) { >+ my $heading_use_search_field = >+ $biblio_tag =~ /^[127]/ ? 'Heading-use-main-or-added-entry' >+ : $biblio_tag =~ /^6/ ? 'Heading-use-subject-added-entry' >+ : $biblio_tag =~ /^[48]/ ? 'Heading-use-series-added-entry' >+ : undef; >+ if ($heading_use_search_field) { >+ push @marclist, $heading_use_search_field; >+ push @and_or, 'and'; >+ push @excluding, ''; >+ push @operator, 'is'; >+ push @value, 'a'; >+ } >+ } >+ } >+ > my $builder = Koha::SearchEngine::QueryBuilder->new( > { index => $Koha::SearchEngine::AUTHORITIES_INDEX } ); > my $searcher = Koha::SearchEngine::Search->new( >diff --git a/installer/data/mysql/atomicupdate/bug_38494-ConsiderHeadingUse_syspref.pl b/installer/data/mysql/atomicupdate/bug_38494-ConsiderHeadingUse_syspref.pl >index b72ae8ae53..a299fcc645 100755 >--- a/installer/data/mysql/atomicupdate/bug_38494-ConsiderHeadingUse_syspref.pl >+++ b/installer/data/mysql/atomicupdate/bug_38494-ConsiderHeadingUse_syspref.pl >@@ -9,7 +9,7 @@ return { > my ( $dbh, $out ) = @$args{qw(dbh out)}; > > $dbh->do( >-q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('ConsiderHeadingUse', '0', NULL, 'Consider authority heading use (main/added entry, or subject, or series title) in cataloging and linking', 'YesNo')} >+ q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('ConsiderHeadingUse', '0', NULL, 'Consider authority heading use (main/added entry, or subject, or series title) in cataloging and linking', 'YesNo')} > ); > > say_success( $out, "Added system preference 'ConsiderHeadingUse'" ); >-- >2.39.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 38494
:
174863
|
174864
|
174865
|
174866
|
174897
|
174898
|
174899
|
174914
|
174915