From 82eedd2261abec2e260cf4b05c248eac8d9932bc Mon Sep 17 00:00:00 2001 From: Baptiste Wojtkowski Date: Mon, 24 Mar 2025 16:30:50 +0100 Subject: [PATCH] BZ39436: Have the matcher check the existence of the record returned by search engine TEST PLAN: TBD --- C4/Matcher.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; + } } } -- 2.30.2