Skip to content
Snippets Groups Projects
Commit 4a5eee6b authored by Stefan Froemken's avatar Stefan Froemken Committed by Anja Leichsenring
Browse files

[BUGFIX] Fix type error in for pageType in f:uri.page ViewHelper

The Fluid ViewHelper `f:uri.page` will now cast argument `pageType` to
int before using it.

Resolves: #100845
Releases: main, 12.4, 11.5
Change-Id: Ifbda5befa0757975c20411bfac2549a3affab9bf
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79132


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent 54f3fa0e
Branches
Tags
No related merge requests found
......@@ -94,7 +94,7 @@ class PageViewHelper extends AbstractViewHelper
}
$pageUid = $arguments['pageUid'];
$additionalParams = $arguments['additionalParams'];
$pageType = $arguments['pageType'];
$pageType = (int)($arguments['pageType'] ?? 0);
$noCache = $arguments['noCache'];
$section = $arguments['section'];
$language = $arguments['language'] ?? null;
......
......@@ -43,6 +43,10 @@ class PageViewHelperTest extends FunctionalTestCase
'<f:link.page pageUid="1">linkMe</f:link.page>',
'<a href="/">linkMe</a>',
],
'link to root page with page type' => [
'<f:link.page pageUid="1" pageType="1234">linkMe</f:link.page>',
'<a href="/?type=1234">linkMe</a>',
],
'link to page sub page' => [
'<f:link.page pageUid="3">linkMe</f:link.page>',
'<a href="/dummy-1-2/dummy-1-2-3">linkMe</a>',
......
......@@ -43,6 +43,10 @@ class PageViewHelperTest extends FunctionalTestCase
'<f:uri.page pageUid="1" />',
'/',
],
'link to root page with page type' => [
'<f:uri.page pageUid="1" pageType="1234" />',
'/?type=1234',
],
'link to page sub page' => [
'<f:uri.page pageUid="3" />',
'/dummy-1-2/dummy-1-2-3',
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment