Project

General

Profile

Actions

Bug #81226

closed

LegacyLinkNotationConverter does not work correctly with old links including page type and parameters

Added by Robert Vock over 7 years ago. Updated over 5 years ago.

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,&param=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:
  1. rtrim on $data or $result[pagetype] in LegacyLinkNotationConverter.php
  2. Force integer pageType in PageLinkBuilder.php#L80
    $pageType = (int)$linkDetails['pagetype'] ?? 0;
Actions #1

Updated by Susanne Moog about 6 years ago

  • Sprint Focus set to On Location Sprint
Actions #2

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

Actions #3

Updated by Benni Mack almost 6 years ago

Hey Robert,

could you test the patch I added which reintroduces this behaviour? Thanks!

Actions #4

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

Actions #5

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

Actions #6

Updated by Benni Mack almost 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF