Bug #91741
openRouteEnhancer affects option addQueryString of TypoLink
0%
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 optionaddQueryString
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.
Updated by Anonymous almost 4 years ago
- Related to Bug #88209: Route enhanced parameters not added when using addQueryString added