Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Prevent error when overlay is not available #4244

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading