Project

General

Profile

Actions

Bug #77946

closed

Fluid page link (f:link.page) to different pid using addQueryString not working as expected

Added by Markus Mächler over 7 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2016-09-14
Due date:
% Done:

0%

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

Description

If you are for instance on a page with uid 1 and want to link to a page with uid 2 and set the addQueryString option, the link will be generated for uid 1 instead of 2.

e.g.

We are on page 1
<f:link.page pageUid="2" addQueryString="1">Page 2</f:link.page>

The problem is that the url builder creates a url that looks like yourpage.com?id=2&id=1 where the second id parameter overwrites the first.
I feel like this issue should at least be addressed in TYPO3\CMS\Fluid\ViewHelpers\Link\PageViewHelper where the id parameter could be stripped away if the pageUid is set. It is very counter intuitive if there is a pageUid parameter present but not respected. It could also be fixed in TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder directly, although this might break other code.

Actions #1

Updated by Wouter Wolters over 7 years ago

  • Status changed from New to Needs Feedback

You need to use argumentsToBeExcludedFromQueryString (arguments to be removed from the URI. Only active if $addQueryString = TRUE) to make this work.
Can you try this?

Actions #2

Updated by Markus Mächler over 7 years ago

Wouter Wolters wrote:

You need to use argumentsToBeExcludedFromQueryString (arguments to be removed from the URI. Only active if $addQueryString = TRUE) to make this work.
Can you try this?

That is true, you can make it work like this:

<f:link.page pageUid="2" addQueryString="1" argumentsToBeExcludedFromQueryString="{0: 'id'}">Page 2</f:link.page>

But in my opinion this should not be necessary and is just an ugly workaround. It is very counter intuitive that you would have to exclude the id when you set the page uid explicitly.

Actions #3

Updated by Alexander Opitz about 7 years ago

  • Category set to Fluid
  • Status changed from Needs Feedback to New
Actions #4

Updated by Riccardo De Contardi over 5 years ago

It seems still present as far as I have seen.

Steps to reproduce

1) In your fluid template put something like:

<p><f:link.page pageUid="584" addQueryString="1">link to Page</f:link.page></p>

(where 584 is an existing page)

2) In frontend, go to another page, for example http://yoursite.com/index.php?id=180

The link url will be http://yoursite.com/?id=584&id=180

Actions #5

Updated by Riccardo De Contardi over 4 years ago

Does this still occurs with TYPO3 9.5.x ? At a first glance, it seems not reproducible.

Actions #6

Updated by Markus Mächler over 4 years ago

It seems not to be an issue anymore in TYPO3 9.5.x.

Actions #7

Updated by Riccardo De Contardi over 4 years ago

  • Status changed from New to Needs Feedback

@Markus Mächler thank you for your reply and sorry for my late answer; Do you mind if I close your issue as resolved (version 8 is in "priority bugxix" mode) ?

Thanks again and best regards

Actions #8

Updated by Markus Mächler over 4 years ago

@Riccardo De Contardi I am fine with closing this issue, thanks for your reply!

Actions #9

Updated by Susanne Moog over 4 years ago

  • Status changed from Needs Feedback to Closed
Actions

Also available in: Atom PDF