Bug #88209

Route enhanced parameters not added when using addQueryString

Added by Rudy Gnodde over 2 years ago. Updated 6 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2019-04-25
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

When using addQueryString in a typolink or link ViewHelper the parameters of a route enhanced URL aren't added.

For example: I have a news detail page with the URL https://domain.tld/news/article/news-title. If I add a typolink to that page with "addQueryString = 1" I get the URL https://domain.tld/news

The TypoScript I used to test this is:

lib.test = TEXT
lib.test {
  value = Test
  typolink {
    parameter = 9
    addQueryString = 1
  }
}

The route enhancement is done with the following configuration in the site config:

  News:
    type: Extbase
    limitToPages:
      - 9
    extension: News
    plugin: Pi1
    routes:
      - { routePath: '/article/{news_title}', _controller: 'News::detail', _arguments: {'news_title': 'news'} }
    defaultController: 'News::detail'
    aspects:
      news_title:
        type: PersistedAliasMapper
        tableName: tx_news_domain_model_news
        routeFieldName: path_segment

This is also a problem in the f:link.page ViewHelper (and probably other link, form and uri ViewHelpers)


Related issues

Related to TYPO3 Core - Bug #91741: RouteEnhancer affects option addQueryString of TypoLinkNew2020-07-03

Actions
#1

Updated by Rudy Gnodde over 2 years ago

If I set addQueryString.method = GET (or in the ViewHelpers addQueryStringMethod="GET") it does work. The problem is that by default it uses the QUERY_STRING environment variable in TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::getQueryArguments. The route enhancer doesn't add the parameters to this variable.

#2

Updated by Christian Eßl almost 2 years ago

  • Is Regression set to Yes
#3

Updated by Sven Burkert over 1 year ago

Same here. I'm using newest TYPO3 version (9.5.11).
Thx @Rudy for the useful hint with addQueryStringMethod="GET".

#4

Updated by Claus Fassing 9 months ago

I run into the same issue with TYPO3 version 9.5.20
This happens in connection with a login and the redirection on a news detail page
Many thanks to Rudy Gnodde for the workaround hint!

#5

Updated by Christian Buelter 8 months ago

I can confirm this issue for TYPO3 10.4.9

#6

Updated by Dirk Klimpel 7 months ago

  • Related to Bug #91741: RouteEnhancer affects option addQueryString of TypoLink added
#7

Updated by Kevin von Spiczak 6 months ago

I have the same issue (running TYPO3 9.5.23), thanks for the workaround @Rudy Gnodde!

Also available in: Atom PDF