Bugzilla – Attachment 147987 Details for
Bug 33159
Thesaurus is not defined by second indicator for controlled fields outside of 6XX
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33159: Correctly form thesaurus term for non-subject headings
Bug-33159-Correctly-form-thesaurus-term-for-non-su.patch (text/plain), 3.52 KB, created by
Phil Ringnalda
on 2023-03-08 23:41:48 UTC
(
hide
)
Description:
Bug 33159: Correctly form thesaurus term for non-subject headings
Filename:
MIME Type:
Creator:
Phil Ringnalda
Created:
2023-03-08 23:41:48 UTC
Size:
3.52 KB
patch
obsolete
>From db3655cb847bce38b7170495164145cb351a5583 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 7 Mar 2023 19:23:44 +0000 >Subject: [PATCH] Bug 33159: Correctly form thesaurus term for non-subject > headings > >Bug 30280 fixed things for subject heading, but didn't take into account >that all non-subject headings are considered LCSH - this means we can't >really handle different thesauri for controlled headings outside of >subjects - maybe a topic for a new bug, but we should fix matching for >them now > >To test: > 1 - Set sysprefs: > RequireChoosingExistingAuthority - don't require > AutoCreateAuthorities - generate > CatalogModuleRelink - Do > AutoLinkBiblio - Do > LinkerModule - first match > 2 - Find a record with an author attached to an authority, I used > biblionumber 3 "Introduction to Attic Greek" > 3 - Edit in advanced editor > 4 - Delete the $9 link > 5 - Save the record > 6 - It generates a new number > 7 - Repeat 4-5, it does it again > 8 - Apply patch and restart all > 9 - Repeat 4-5 >10 - It links to the original authority > >Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> >--- > C4/Heading.pm | 34 ++++++++++++++++------------------ > 1 file changed, 16 insertions(+), 18 deletions(-) > >diff --git a/C4/Heading.pm b/C4/Heading.pm >index 7541a56205..cce3abf6fc 100644 >--- a/C4/Heading.pm >+++ b/C4/Heading.pm >@@ -194,7 +194,7 @@ sub _search { > my $self = shift; > my $index = shift || undef; > my $skipmetadata = shift || undef; >- my $ind2 = $self->{field}->{_ind2}; >+ my $thesaurus = $self->{thesaurus}; > my $subject_heading_thesaurus = ''; > my @marclist; > my @and_or; >@@ -209,23 +209,29 @@ sub _search { > push @value, $self->{'search_form'}; > } > >- if ($self->{'thesaurus'}) { >- if ($ind2 eq '0') { >+ if ( $thesaurus ) { >+ # This is calculated in C4/Heading/MARC21.pm - not used for UNIMARC >+ if ($thesaurus eq 'lcsh') { > $subject_heading_thesaurus = 'a'; >- } elsif ($ind2 eq '1') { >+ } elsif ($thesaurus eq 'lcac') { > $subject_heading_thesaurus = 'b'; >- } elsif ($ind2 eq '2') { >+ } elsif ($thesaurus eq 'mesh') { > $subject_heading_thesaurus = 'c'; >- } elsif ($ind2 eq '3') { >+ } elsif ($thesaurus eq 'nal') { > $subject_heading_thesaurus = 'd'; >- } elsif ($ind2 eq '4') { >+ } elsif ($thesaurus eq 'notspecified') { > $subject_heading_thesaurus = 'n'; >- } elsif ($ind2 eq '5') { >+ } elsif ($thesaurus eq 'cash') { > $subject_heading_thesaurus = 'k'; >- } elsif ($ind2 eq '6') { >+ } elsif ($thesaurus eq 'rvm') { > $subject_heading_thesaurus = 'v'; >- } else { >+ } else { # We stored the value from $7 as the thesaurus if there was one > $subject_heading_thesaurus = 'z'; >+ push @marclist, 'thesaurus-conventions'; >+ push @and_or, 'and'; >+ push @excluding, ''; >+ push @operator, 'is'; >+ push @value, $self->{'thesaurus'}; > } > push @marclist, 'thesaurus'; > push @and_or, 'and'; >@@ -234,14 +240,6 @@ sub _search { > push @value, $subject_heading_thesaurus; > } > >- if ($ind2 eq '7') { >- push @marclist, 'thesaurus-conventions'; >- push @and_or, 'and'; >- push @excluding, ''; >- push @operator, 'is'; >- push @value, $self->{'thesaurus'}; >- } >- > require Koha::SearchEngine::QueryBuilder; > require Koha::SearchEngine::Search; > >-- >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 33159
:
147881
|
147882
|
147970
|
147980
|
147986
|
147987
|
147988
|
148032
|
148033
|
148034
|
148050
|
148051
|
148052
|
148227
|
148228
|
148229
|
148414
|
148415
|
148416