Skip to content

Commit

Permalink
Merge pull request #63 from Andreas-Sommer/master
Browse files Browse the repository at this point in the history
Add config redirectEvenInFallbackMode
  • Loading branch information
davkraid authored Jan 6, 2025
2 parents 7cf0065 + 89c5aa2 commit 4dcb79b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Classes/Verdict/Redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
$allowFallback = (bool) ($this->configuration['allowFallback'] ?? false);
if (!isset($page['_PAGES_OVERLAY_UID']) && $allowFallback === false) {
$this->logger->info(sprintf('There is no page overlay for page %d and language %d', $page['uid'], $targetLanguageId));

return null;
Expand Down
17 changes: 17 additions & 0 deletions Documentation/Functions/AssignLanguage/Verdicts/Redirect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,23 @@ Override Query Parameter
directed to the German language version of the page e.g. by clicking in the language menu. The language menu must then
generate all links with the query parameter attached (:code:`/de/?setLang`). The value of the parameter does not matter.

.. _functions-assignLanguage-verdicts-redirect-configuration-allowFallback:

Allow Fallback
~~~~~~~~~~~~~~~~~~~~~~
.. container:: table-row

Property
config.tx_locate.verdicts.[name].allowFallback
Data type
integer
Default
:code:`0`
Description
If the option is enabled, redirection to a non-localized page is allowed. In this case, the page is accessed under the
corresponding language URL, even if it does not exist. The displayed content corresponds to the defined fallback page
of your site configuration.

.. _functions-assignLanguage-verdicts-redirect-example:

Example
Expand Down

0 comments on commit 4dcb79b

Please sign in to comment.