RouteEnhancer affects option addQueryString of TypoLink
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.
- 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
- When creating a new link/URL using the
typolinkfunctionality, we can use the option
addQueryStringto 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 "
The environment variable QUERY_STRING does not contain the parameters which are hidden in the URL path by a routeEnhancer.
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.