Commit b93e210a authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[BUGFIX] Use correct typolink config key for fragments

While the fragment in a LinkResult is named "fragment",
is the typolink related config key "section". Related
ViewHelpers do now use the correct key again.

Resolves: #99658
Releases: main
Change-Id: I9f31c651e44887588b29f472348c3dcf694e6ecc
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77531


Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
parent c17e30a7
......@@ -161,7 +161,7 @@ final class PageViewHelper extends AbstractTagBasedViewHelper
$typolinkConfiguration['language'] = $language;
}
if ($section) {
$typolinkConfiguration['fragment'] = $section;
$typolinkConfiguration['section'] = $section;
}
if ($linkAccessRestrictedPages) {
$typolinkConfiguration['linkAccessRestrictedPages'] = 1;
......
......@@ -184,7 +184,7 @@ final class PageViewHelper extends AbstractViewHelper
$typolinkConfiguration['language'] = $language;
}
if ($section) {
$typolinkConfiguration['fragment'] = $section;
$typolinkConfiguration['section'] = $section;
}
if ($linkAccessRestrictedPages) {
$typolinkConfiguration['linkAccessRestrictedPages'] = 1;
......
......@@ -188,6 +188,10 @@ class PageViewHelperTest extends FunctionalTestCase
'<f:link.page pageUid="1">linkMe</f:link.page>',
'<a href="/">linkMe</a>',
],
'link to root page with section' => [
'<f:link.page pageUid="1" section="c13">linkMe</f:link.page>',
'<a href="/#c13">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>',
......
......@@ -188,6 +188,10 @@ class PageViewHelperTest extends FunctionalTestCase
'<f:uri.page pageUid="1" />',
'/',
],
'link to root page with section' => [
'<f:uri.page pageUid="1" section="c13" />',
'/#c13',
],
'link to page sub page' => [
'<f:uri.page pageUid="3" />',
'/dummy-1-2/dummy-1-2-3',
......
Supports Markdown
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