Project

General

Profile

Actions

Bug #75974

closed

UriBuilder will not generate pageType 0 links

Added by Bernhard Kraft about 8 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Won't have this time
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2016-04-28
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

When the current page type (TSFE->type) is different than "0" the UriBuilder can not generate any links to pageType "0" as the "targetPageType" member variable gets compared against being different from "0".

Just changing the check to:

if ($this->targetPageType !== (int)$GLOBALS['TSFE']->type) {

https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/typo3/sysext/extbase/Classes/Mvc/Web/Routing/UriBuilder.php#l719

will break existing templates. Every link for non-type-0 pages would need to have the "pageType" parameter - else every link would link back to type-0. To solve this issue a similar approach than for the $targetPageUid has to get taken (Using "NULL" as default then targetPageType is not set).

There is no patch attached because currently even when fixing this issue in the UriBuilder the whole link will not respect the "targetPageType" from the UriBuilder when the "linkVars" TypoScript option is set. As this is normally the case for the "type" parameter changing this issue will not resolve the problem.

So currently the solution is, to set the "type" parameter in the additionalParams of an f:uri.page viewHelper for example:

{f:uri.page(pageUid: '{settings.productPdfPage}', additionalParams: '{type: \'0\', preispdf: \'1\', hotelid: \'{product}\'}')}

Actions

Also available in: Atom PDF