diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Link/ActionViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Link/ActionViewHelper.php index 73666ac371e33d6d443782a1e43385563658192b..090cecd44bb6375b6c7a3daf4872584f86d74a9f 100644 --- a/typo3/sysext/fluid/Classes/ViewHelpers/Link/ActionViewHelper.php +++ b/typo3/sysext/fluid/Classes/ViewHelpers/Link/ActionViewHelper.php @@ -62,6 +62,7 @@ final class ActionViewHelper extends AbstractTagBasedViewHelper $this->registerArgument('pageUid', 'int', 'Target page. See TypoLink destination'); $this->registerArgument('pageType', 'int', 'Type of the target page. See typolink.parameter'); $this->registerArgument('noCache', 'bool', 'Set this to disable caching for the target page. You should not need this.'); + $this->registerArgument('language', 'string', 'link to a specific language - defaults to the current language, use a language ID or "current" to enforce a specific language', false); $this->registerArgument('section', 'string', 'The anchor to be added to the URI'); $this->registerArgument('format', 'string', 'The requested format, e.g. ".html'); $this->registerArgument('linkAccessRestrictedPages', 'bool', 'If set, links pointing to access restricted pages will still link to the page even though the page cannot be accessed.'); @@ -91,6 +92,7 @@ final class ActionViewHelper extends AbstractTagBasedViewHelper $pageUid = (int)$this->arguments['pageUid'] ?: null; $pageType = (int)($this->arguments['pageType'] ?? 0); $noCache = (bool)($this->arguments['noCache'] ?? false); + $language = $this->arguments['language'] ?? null; $section = (string)$this->arguments['section']; $format = (string)$this->arguments['format']; $linkAccessRestrictedPages = (bool)($this->arguments['linkAccessRestrictedPages'] ?? false); @@ -106,6 +108,7 @@ final class ActionViewHelper extends AbstractTagBasedViewHelper ->setRequest($request) ->setTargetPageType($pageType) ->setNoCache($noCache) + ->setLanguage($language) ->setSection($section) ->setFormat($format) ->setLinkAccessRestrictedPages($linkAccessRestrictedPages) diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ActionViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ActionViewHelper.php index f657a84191d10f77117e20b1bb902a1cf922f952..3fd0a9b3d96817f6774818710b23c19c368779ea 100644 --- a/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ActionViewHelper.php +++ b/typo3/sysext/fluid/Classes/ViewHelpers/Uri/ActionViewHelper.php @@ -53,6 +53,7 @@ final class ActionViewHelper extends AbstractViewHelper $this->registerArgument('pageUid', 'int', 'Target page. See TypoLink destination'); $this->registerArgument('pageType', 'int', 'Type of the target page. See typolink.parameter', false, 0); $this->registerArgument('noCache', 'bool', 'Set this to disable caching for the target page. You should not need this.', false); + $this->registerArgument('language', 'string', 'link to a specific language - defaults to the current language, use a language ID or "current" to enforce a specific language', false); $this->registerArgument('section', 'string', 'The anchor to be added to the URI', false, ''); $this->registerArgument('format', 'string', 'The requested format, e.g. ".html', false, ''); $this->registerArgument('linkAccessRestrictedPages', 'bool', 'If set, links pointing to access restricted pages will still link to the page even though the page cannot be accessed.', false, false); @@ -76,6 +77,7 @@ final class ActionViewHelper extends AbstractViewHelper $pageUid = (int)($arguments['pageUid'] ?? 0); $pageType = (int)($arguments['pageType'] ?? 0); $noCache = (bool)($arguments['noCache'] ?? false); + $language = $arguments['language'] ?? null; /** @var string|null $section */ $section = $arguments['section'] ?? null; /** @var string|null $format */ @@ -99,6 +101,7 @@ final class ActionViewHelper extends AbstractViewHelper /** @var array|null $arguments */ $arguments = $arguments['arguments'] ?? []; + /** @var UriBuilder $uriBuilder */ $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); $uriBuilder->reset()->setRequest($request); @@ -133,6 +136,8 @@ final class ActionViewHelper extends AbstractViewHelper $uriBuilder->setLinkAccessRestrictedPages(true); } + $uriBuilder->setLanguage($language); + return $uriBuilder->uriFor($action, $arguments, $controller, $extensionName, $pluginName); } }