Bug #91741

RouteEnhancer affects option addQueryString of TypoLink

Added by Stephan Ude about 1 year ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2020-07-03
Due date:
% Done:

0%

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

Description

I am actually not sure if this is in fact a bug or if this was intended, but to me it feels like this behaviour is unintentional. Maybe others have some thoughts on this, too.

Setup

  • With a routeEnhancer we can hide query parameters inside the URL path.
  • When resolving such a URL the hidden parameters are identified and written back into the global $_GET variable.
  • When creating a new link/URL using the typolink functionality, we can use the option addQueryString to copy the current query parameters into the URL that is about to be generated.
  • Without adding a method (like "GET" or "POST") the source for the query parameters is not the global variable $_GET but rather the environment variable "QUERY_STRING".

Issue

The environment variable QUERY_STRING does not contain the parameters which are hidden in the URL path by a routeEnhancer.

Result

The majority of typolinks that I came across that had set the option addQueryString did not specify a method.
Which results in the hidden query parameters not being copied over to the newly created URL. This seems unintuitive to me.

If it was intended that the method must be set to "GET" in order to actually get all current query parameters, then this ticket can be closed right away.

Personally I would say that it is desirable to have all query parameters (including the hidden ones) being copied as a default behaviour, because I expect a routeEnhancer to not affect the link generation.


Related issues

Related to TYPO3 Core - Bug #88209: Route enhanced parameters not added when using addQueryStringNew2019-04-25

Actions
#1

Updated by Dirk Klimpel 9 months ago

  • Related to Bug #88209: Route enhanced parameters not added when using addQueryString added

Also available in: Atom PDF