From 028173f77253abb8fadaac3421972e3de800fd4b Mon Sep 17 00:00:00 2001 From: Peter Kraume Date: Tue, 5 Dec 2023 17:08:27 +0100 Subject: [PATCH] [BUGFIX] Prevent undefined array key warning Fixes: #565 --- Classes/Service/LinkingSuggestionsService.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Classes/Service/LinkingSuggestionsService.php b/Classes/Service/LinkingSuggestionsService.php index 126aef15..d6b64572 100644 --- a/Classes/Service/LinkingSuggestionsService.php +++ b/Classes/Service/LinkingSuggestionsService.php @@ -254,6 +254,9 @@ protected function groupWordsByRecord(array $candidateWords): array $candidateWordsByRecords = []; foreach ($candidateWords as $candidateWord) { $recordKey = $candidateWord['uid_foreign'] . '-' . $candidateWord['tablenames']; + if (!array_key_exists('weight', $candidateWord) || array_key_exists('df', $candidateWord)) { + continue; + } $candidateWordsByRecords[$recordKey][$candidateWord['stem']] = [ 'weight' => (int)$candidateWord['weight'], 'df' => (int)$candidateWord['df']