Issue Bug Closed

#91741RouteEnhancer affects option addQueryString of TypoLink

Stephan Ude 07/03/20, 17:47 updated 11/08/26, 19:49

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.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 4

  1. Benni Mack commented and changed status New Closed <span data-processor="relativetime" data-value="2026-11-08T19:49:27+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.