#91741RouteEnhancer affects option addQueryString of TypoLink
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
routeEnhancerwe can hide query parameters inside the URL path. - When resolving such a URL the hidden parameters are identified and written back into the global
$_GETvariable. - When creating a new link/URL using the
typolinkfunctionality, we can use the optionaddQueryStringto 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
$_GETbut 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.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Related issues 3
History 4
-
Anonymous changed Related to #88209 <span data-processor="relativetime" data-value="2020-12-30T14:28:39+00:00" > 12/30/20, 14:28 </span>
-
Benni Mack commented and changed status
NewClosed <span data-processor="relativetime" data-value="2026-11-08T19:49:27+00:00" > 11/08/26, 19:49 </span> -
Benni Mack changed Related to #93041 <span data-processor="relativetime" data-value="2026-11-08T19:49:35+00:00" > 11/08/26, 19:49 </span>
-
Benni Mack changed Related to #98488 <span data-processor="relativetime" data-value="2026-11-08T19:49:48+00:00" > 11/08/26, 19:49 </span>
Resolved since TYPO3 v11: addQueryString.method and with it the QUERY_STRING fallback were removed with #93041, and since v12 (#98488) addQueryString takes its parameters from the routing result (PageArguments::getRouteArguments()). Parameters resolved by route enhancers from the URL path are therefore included. Use addQueryString = untrusted to also carry over query parameters that are not mapped by routing. Closing.