Bugzilla – Attachment 150977 Details for
Bug 33277
Correctly handle linking subfields with no defined thesaurus
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33277: Do not search using thesaurus when linking non 6XX fields
Bug-33277-Do-not-search-using-thesaurus-when-linki.patch (text/plain), 4.41 KB, created by
Marcel de Rooy
on 2023-05-10 12:09:55 UTC
(
hide
)
Description:
Bug 33277: Do not search using thesaurus when linking non 6XX fields
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-05-10 12:09:55 UTC
Size:
4.41 KB
patch
obsolete
>From f7dbd5ccad449abda1811f9895234ea1bde4cdf4 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 20 Mar 2023 15:44:17 +0000 >Subject: [PATCH] Bug 33277: Do not search using thesaurus when linking non 6XX > fields >Content-Type: text/plain; charset=utf-8 > >This patch sets thesaurus as undefined when linking any field except 6XX > >This fixes the case where authrotiy records don't have the thesaurus defined > >Consequently - this means that Koha does not support multiple thesaurus records >for authorities outside of subjects > >i.e. Using the default linker, and having both an LCSH and Sears record for 'Shakespeare,William' >A 100 entry will find two results and the heading won't be linked. Previously we always linked to the LCSH > >To test: >1 - Import the attached auths and biblio (from bug 33159 comment 24) >2 - Set system preferences: > RequireChoosingExistingAuthority - don't require > AutoCreateAuthorities - don't generate > CatalogModuleRelink - Do > LinkerKeepStale - Don't > LinkerModule - default > LinkerRelink - do >3 - Edit the imported bib >4 - Save it >5 - Headings are not linked except 600 >6 - Apply patch >7 - Restart all >8 - Edit and save record >9 - Headings are successfully linked > >Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Heading/MARC21.pm | 2 +- > t/db_dependent/Heading.t | 3 --- > t/db_dependent/Heading_MARC21.t | 4 ++-- > 3 files changed, 3 insertions(+), 6 deletions(-) > >diff --git a/C4/Heading/MARC21.pm b/C4/Heading/MARC21.pm >index 87d825bb4c..652c300282 100644 >--- a/C4/Heading/MARC21.pm >+++ b/C4/Heading/MARC21.pm >@@ -339,7 +339,7 @@ sub parse_heading { > my $thesaurus = > $tag =~ m/6../ > ? _get_subject_thesaurus($field) >- : "lcsh"; # use 'lcsh' for names, UT, etc. >+ : undef; # We can't know the thesaurus for non-subject fields > my $search_heading = > _get_search_heading( $field, $field_info->{'subfields'} ); > my $display_heading = >diff --git a/t/db_dependent/Heading.t b/t/db_dependent/Heading.t >index 7aa14c94aa..db7c8ffc14 100755 >--- a/t/db_dependent/Heading.t >+++ b/t/db_dependent/Heading.t >@@ -114,7 +114,6 @@ subtest "_search tests" => sub { > $terms = $search_query->{query}->{bool}->{must}; > $expected_terms = [ > { term => { 'match-heading.ci_raw' => 'Yankovic, Al 1959' } }, >- { term => { 'subject-heading-thesaurus.ci_raw' => 'a' } }, > ]; > is_deeply( $terms, $expected_terms, "Search formed as expected for a non-subject field with single punctuation mark"); > >@@ -124,7 +123,6 @@ subtest "_search tests" => sub { > $terms = $search_query->{query}->{bool}->{must}; > $expected_terms = [ > { term => { 'match-heading.ci_raw' => 'Yankovic, Al 1959' } }, >- { term => { 'subject-heading-thesaurus.ci_raw' => 'a' } }, > ]; > is_deeply( $terms, $expected_terms, "Search formed as expected for a non-subject field with double punctuation, hyphen+comma"); > >@@ -134,7 +132,6 @@ subtest "_search tests" => sub { > $terms = $search_query->{query}->{bool}->{must}; > $expected_terms = [ > { term => { 'match-heading.ci_raw' => 'Tolkien, J.R.R' } }, >- { term => { 'subject-heading-thesaurus.ci_raw' => 'a' } }, > ]; > is_deeply( $terms, $expected_terms, "Search formed as expected for a non-subject field with double punctuation, period+comma "); > >diff --git a/t/db_dependent/Heading_MARC21.t b/t/db_dependent/Heading_MARC21.t >index 32bd0a07cc..9f94cf2234 100755 >--- a/t/db_dependent/Heading_MARC21.t >+++ b/t/db_dependent/Heading_MARC21.t >@@ -25,12 +25,12 @@ SKIP: { > $heading = C4::Heading->new_from_field($field); > is($heading->display_form(), 'The dark is rising ;', 'Display form generation'); > is($heading->search_form(), 'The dark is rising', 'Search form generation'); >- is($heading->{thesaurus}, 'lcsh', 'Thesaurus generation'); >+ ok( !defined $heading->{thesaurus}, 'Thesaurus is not generated outside of 6XX fields'); > > $field = MARC::Field->new( '100', '1', '', a => 'Yankovic, Al', d => '1959-' ); > $heading = C4::Heading->new_from_field($field); > is($heading->display_form(), 'Yankovic, Al 1959-', 'Display form generation'); > is($heading->search_form(), 'Yankovic, Al 1959', 'Search form generation'); >- is($heading->{thesaurus}, 'lcsh', 'Thesaurus generation'); >+ ok( !defined $heading->{thesaurus}, 'Thesaurus is not generated outside of 6XX fields'); > > } >-- >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 33277
:
148417
|
148418
|
148419
|
148492
|
148493
|
148494
|
148495
|
148500
|
148527
|
148528
|
148529
|
148530
|
148531
|
148734
|
148735
|
148957
|
149837
|
149838
|
149839
|
149840
|
149841
|
149842
|
150890
|
150891
| 150977 |
150978
|
150979
|
150980
|
150981
|
150982
|
150983