Actions
Bug #81226
closedLegacyLinkNotationConverter does not work correctly with old links including page type and parameters
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Target version:
-
Start date:
2017-05-15
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
Sprint Focus:
On Location Sprint
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;
Actions