Summary: | C4/Matcher does not check if the biblio returned by search exists in DB | ||
---|---|---|---|
Product: | Koha | Reporter: | Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski> |
Component: | Cataloging | Assignee: | Bugs List <koha-bugs> |
Status: | NEW --- | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | dcook, m.de.rooy |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Attachments: | BZ39436: Have the matcher check the existence of the record returned by search engine |
Description
Baptiste Wojtkowski (bwoj)
2025-03-24 15:29:48 UTC
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 |