C4/Matcher does not check if the biblio returned by search exists in DB. This can be a problem for example if you then try to attach a command to the biblio
Solution should look like this, but I don't have a testplan : diff --git a/C4/Matcher.pm b/C4/Matcher.pm index 9369782f..8c6075f6 100644 --- a/C4/Matcher.pm +++ b/C4/Matcher.pm @@ -721,8 +721,11 @@ sub get_matches { ( $biblionumber_tag > 10 ) ? $target_record->field($biblionumber_tag)->subfield($biblionumber_subfield) : $target_record->field($biblionumber_tag)->data(); - $matches->{$id}->{score} += $matchpoint->{score}; - $matches->{$id}->{record} = $target_record; + my $biblio = Koha::Biblio->find($id); + if ($biblio){ + $matches->{$id}->{score} += $matchpoint->{score}; + $matches->{$id}->{record} = $target_record; + } } }
I'd imagine the test plan would be to create the record in the DB and index it, export the record, turn off the background indexer, delete the record, import the record with a matching rule for the Koha identifier (e.g. 999$c in MARC21 - not sure of UNIMARC equivalent).
Hi David, thx for the test plan ! Do you know how to stop the background indexer in ktd ?
Created attachment 179717 [details] [review] BZ39436: Have the matcher check the existence of the record returned by search engine TEST PLAN: TBD