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}\'}')}
Updated by Bernhard Kraft over 8 years ago
Is it possible to change this issue to "won't" fix but still let it show up when searching.
This "is" an issue but not easily fixable currently except by touching the "mother of all link generation methods "TSFE->tmpl->linkData()" which could break a lot.
Updated by Benni Mack about 6 years ago
- Status changed from New to Needs Feedback
Hey Bernhard,
is this still an issue? As far as I read the code, if you do NOT add a page type in your Extbase configuration / Fluid ViewHelper, it is using pageType=0 (basically omitting it via linkData as well). Well, if you add config.linkVars = type - then this could become an issue.
Could you share more details?
Updated by Riccardo De Contardi over 5 years ago
- Status changed from Needs Feedback to Closed
No feedback since the last 90 days => closing this issue.
If you think that this is the wrong decision or experience the issue again and have more information about how to reproduce your problem, please reopen it or ping me.
Thank you and best regards