Bug #81226
closedLegacyLinkNotationConverter does not work correctly with old links including page type and parameters
100%
Description
TYPO3 7 and below allowed the following as Typolink: PageID,PageType,parameters:
https://docs.typo3.org/typo3cms/TyposcriptReference/7.6/Functions/Typolink/
If I was using 1,0,¶m=2 as typolink, the type-parameter was stripped from the URL as it has the default value. In TYPO3 8, the typeNum will appear in the URL.
The LegacyLinkNotationConverter explodes the type, but the resulting pagetype still contains a trailing comma:
LegacyLinkNotationConverter.php#L154
During link generation, the PageLinkBuilder checks, if pagetype is set and uses it, if is non-empty:
PageLinkBuilder.php#L80
"0," is non-empty and is used instead of 0. But later it is cast to an integer.
I see two possible fixes:- rtrim on $data or $result[pagetype] in LegacyLinkNotationConverter.php
- Force integer pageType in PageLinkBuilder.php#L80
$pageType = (int)$linkDetails['pagetype'] ?? 0;
Updated by Susanne Moog about 6 years ago
- Sprint Focus set to On Location Sprint
Updated by Gerrit Code Review almost 6 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59299
Updated by Benni Mack almost 6 years ago
Hey Robert,
could you test the patch I added which reintroduces this behaviour? Thanks!
Updated by Gerrit Code Review almost 6 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59320
Updated by Gerrit Code Review almost 6 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59321
Updated by Benni Mack almost 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 6bdfd7e6bb394d535f8a1e07cef9f59f1319c0e8.