diff --git a/CHANGELOG.md b/CHANGELOG.md index f527e281..ac83ad4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ We will follow [Semantic Versioning](http://semver.org/). ## UNRELEASED ### Fixed +- Prevent undefined array key warning within `LinkingSuggestionsService` - Missing label of the tx_yoastseo_prominent_word table - Removed exclude=true from tx_yoastseo_prominent_word fields, table already has hideTable - Use `websiteTitle` of site configuration within snippet preview, previously this was only taken from site languages instead of the site itself diff --git a/Classes/Service/LinkingSuggestionsService.php b/Classes/Service/LinkingSuggestionsService.php index 126aef15..ad278175 100644 --- a/Classes/Service/LinkingSuggestionsService.php +++ b/Classes/Service/LinkingSuggestionsService.php @@ -253,6 +253,9 @@ protected function groupWordsByRecord(array $candidateWords): array { $candidateWordsByRecords = []; foreach ($candidateWords as $candidateWord) { + if (!isset($candidateWord['weight'], $candidateWord['df'])) { + continue; + } $recordKey = $candidateWord['uid_foreign'] . '-' . $candidateWord['tablenames']; $candidateWordsByRecords[$recordKey][$candidateWord['stem']] = [ 'weight' => (int)$candidateWord['weight'], @@ -345,7 +348,7 @@ protected function linkRecords(array $scores, array $currentLinks): array 'recordType' => $this->getRecordType($table), 'id' => $uid, 'table' => $table, - 'cornerstone' => (int)$data['tx_yoastseo_cornerstone'], + 'cornerstone' => (int)($data['tx_yoastseo_cornerstone'] ?? 0), 'score' => $score, 'active' => isset($currentLinks[$record]) ];