Bug #75974
closedUriBuilder will not generate pageType 0 links
0%
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) {
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}\'}')}