From 370db8d7573b1712e923cc00b3194b55c5be18b9 Mon Sep 17 00:00:00 2001 From: Andreas Sommer Date: Mon, 9 Dec 2024 14:31:02 +0100 Subject: [PATCH] Add config redirectEvenInFallbackMode allowing redirect to a site that will cause a language fallback --- Classes/Verdict/Redirect.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Classes/Verdict/Redirect.php b/Classes/Verdict/Redirect.php index fcc2edd..bf97720 100644 --- a/Classes/Verdict/Redirect.php +++ b/Classes/Verdict/Redirect.php @@ -191,7 +191,8 @@ private function redirectToPage(): ?RedirectResponse $page = GeneralUtility::makeInstance(PageRepository::class)->getPageOverlay($page, $targetLanguageId); // Overlay record does not exist - if (!isset($page['_PAGES_OVERLAY_UID'])) { + $redirectEvenInFallbackMode = (bool) ($this->configuration['redirectEvenInFallbackMode'] ?? false); + if (!isset($page['_PAGES_OVERLAY_UID']) && $redirectEvenInFallbackMode === false) { $this->logger->info(sprintf('There is no page overlay for page %d and language %d', $page['uid'], $targetLanguageId)); return null;