Skip to content

Commit

Permalink
[BUGFIX] Prevent error when overlay is not available
Browse files Browse the repository at this point in the history
This fixes:

Core: Error handler (BE): PHP Warning: Trying to access array offset on value of type null in /var/www/vendor/apache-solr-for-typo3/solr/Classes/ContentObject/Relation.php line 311
  • Loading branch information
magicsunday authored and dkd-kaehm committed Dec 19, 2024
1 parent 0c9d728 commit 3cd14f2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Classes/ContentObject/Relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,12 @@ protected function resolveRelatedValue(
string $foreignTableName = '',
): array {
if ($this->getLanguageUid($parentContentObject) > 0 && !empty($foreignTableName)) {
$relatedRecord = $this->getFrontendOverlayService($parentContentObject)->getOverlay($foreignTableName, $relatedRecord);
$overlayRelatedRecord = $this->getFrontendOverlayService($parentContentObject)->getOverlay($foreignTableName, $relatedRecord);
// sys_page->getLanguageOverlay() may return NULL if overlays were activated but no overlay
// was found and LanguageAspect was NOT set to MIXED
//
// If so rely on original record data
$relatedRecord = is_array($overlayRelatedRecord) ? $overlayRelatedRecord : $relatedRecord;
}

$contentObject = clone $parentContentObject;
Expand Down

0 comments on commit 3cd14f2

Please sign in to comment.