Bugzilla – Attachment 153236 Details for
Bug 26611
Required match checks don't work for authority records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26611: [22.05] Make authority record matching use required match checks
Bug-26611-2205-Make-authority-record-matching-use-.patch (text/plain), 2.82 KB, created by
Alex Buckley
on 2023-07-10 03:12:25 UTC
(
hide
)
Description:
Bug 26611: [22.05] Make authority record matching use required match checks
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2023-07-10 03:12:25 UTC
Size:
2.82 KB
patch
obsolete
>From ce2ae0d8e95cb8e8312ad04c70a04a2d921c2284 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 23 May 2023 03:32:59 +0000 >Subject: [PATCH] Bug 26611: [22.05] Make authority record matching use > required match checks > >This patch fixes record matching for authorities to correctly apply required match checks. > >To test on Koha 22.05: > >1) Create a record matching rule: > >Threshold: 100 >Record type: Authority record > >Match point 1 >Search index: subject-topical >Score: 100 >Tag: 150 >Subfields: a > >Match check 1 >Both source and target record check fields: >Tag: 040 >Subfields: a > >This rule says we want to match on the topical term heading, then confirm the match with 040$a. > >2) Create two topical term authority records > >Authority 1: >150$a: Test >040$a: A > >Authority 2: >150$a: Test >040$a: B > >3) Export authority 2 and save > >4) Go to Cataloging -> Stage records for import > >5) Upload your downloaded authority 2 file. Change the record type to Authority. Choose your new record matching rule. > >6) Stage for import. > >7) Confirm that with the record matching rule applied, both authorities 1 and 2 show as possible matches, even though only authority 2 has a matching 040$a. > >8) Apply the patch and restart services > >9) Change the matching rule to "Do not look for matching records" and apply. This is to essentially refresh the page. > >10) Change the matching rule to your new matching rule and apply. Confirm only the matching authority 2 shows and is selected. > >Sponsored-by: Waikato Institute of Technology >--- > C4/Matcher.pm | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > >diff --git a/C4/Matcher.pm b/C4/Matcher.pm >index 7322c14417e..42011f7419f 100644 >--- a/C4/Matcher.pm >+++ b/C4/Matcher.pm >@@ -30,6 +30,7 @@ use Koha::Util::Normalize qw( > remove_spaces > upper_case > ); >+use C4::AuthoritiesMarc qw( GetAuthority ); > > =head1 NAME > >@@ -700,8 +701,9 @@ sub get_matches { > > foreach my $result (@$authresults) { > my $id = $result->{authid}; >+ my $target_record = GetAuthority($id); > $matches->{$id}->{score} += $matchpoint->{'score'}; >- $matches->{$id}->{record} = $id; >+ $matches->{$id}->{record} = $target_record; > } > } > } >@@ -729,6 +731,15 @@ sub get_matches { > } > } elsif ($self->{'record_type'} eq 'authority') { > require C4::AuthoritiesMarc; >+ # get rid of any that don't meet the required checks >+ $matches = { >+ map { >+ _passes_required_checks( $source_record, $matches->{$_}->{'record'}, $self->{'required_checks'} ) >+ ? ( $_ => $matches->{$_} ) >+ : () >+ } keys %$matches >+ }; >+ > foreach my $id (keys %$matches) { > push @results, { > record_id => $id, >-- >2.20.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 26611
:
151549
|
151608
|
151622
| 153236