Bugzilla – Attachment 98021 Details for
Bug 24348
Record matching rules: required match checks does not work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24348: Pass marc record to _passes_required_checks
Bug-24348-Pass-marc-record-to-passesrequiredchecks.patch (text/plain), 2.72 KB, created by
Jonathan Druart
on 2020-01-28 12:16:06 UTC
(
hide
)
Description:
Bug 24348: Pass marc record to _passes_required_checks
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-01-28 12:16:06 UTC
Size:
2.72 KB
patch
obsolete
>From 057bcdc77c4b2cd3fce3079873a34ce75655d39b Mon Sep 17 00:00:00 2001 >From: Andreas Jonsson <andreas.jonsson@kreablo.se> >Date: Sun, 5 Jan 2020 13:02:13 +0000 >Subject: [PATCH] Bug 24348: Pass marc record to _passes_required_checks > >Test plan: > >* Add record matching rule: > > Matching rule code: test > Description: 001 and 003 > Match threshold: 1000 > Record type: Bibliografic record > > Match points: > Search index: Control-number > Score: 1000 > Tag: 001 > Subfields: > Offset: > Length: > Normalization rule: none > > Required match checks: > > Source (incoming) record check field > > Tag: 003 > Subfields: > Offset: > Length: > Normalization rule: none > > Target (database) record check field > > Tag: 003 > Subfields: > Offset: > Length: > Normalization rule: none > >* Note the match rule identity number. >* Stage a marc-file for import, for instance this one ftp://ftp.libris.kb.se/pub/export2/X/marc/X.20200104.marc > >sudo /usr/sbin/koha-shell -c "perl /home/vagrant/kohaclone/misc/stage_file.pl --match 4 --file 'X.20200104.marc' --format ISO2709 --comment 'test'" kohadev > >* Note the batch number and commit the file using the batch number: > >sudo /usr/sbin/koha-shell -c "perl /home/vagrant/kohaclone/misc/commit_file.pl --batch-number 1" kohadev > >* Again, stage the same marc-file for import: > >sudo /usr/sbin/koha-shell -c "perl /home/vagrant/kohaclone/misc/stage_file.pl --match 4 --file 'X.20200104.marc' --format ISO2709 --comment 'test'" kohadev > >* Note the number of records matched. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >I did not test, trusting author and SO. Changes make perfect sense to >me. >--- > C4/Matcher.pm | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > >diff --git a/C4/Matcher.pm b/C4/Matcher.pm >index 84ceab2935..949920c7e1 100644 >--- a/C4/Matcher.pm >+++ b/C4/Matcher.pm >@@ -726,7 +726,7 @@ sub get_matches { > # get rid of any that don't meet the required checks > $matches = { > map { >- _passes_required_checks( $source_record, $_, $self->{'required_checks'} ) >+ _passes_required_checks( $source_record, $matches->{$_}->{'record'}, $self->{'required_checks'} ) > ? ( $_ => $matches->{$_} ) > : () > } keys %$matches >@@ -790,8 +790,7 @@ sub dump { > } > > sub _passes_required_checks { >- my ($source_record, $target_blob, $matchchecks) = @_; >- my $target_record = MARC::Record->new_from_usmarc($target_blob); # FIXME -- need to avoid parsing record twice >+ my ($source_record, $target_record, $matchchecks) = @_; > > # no checks supplied == automatic pass > return 1 if $#{ $matchchecks } == -1; >-- >2.11.0
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 24348
:
96825
|
97993
| 98021