[TYPO3-core] RFC: Bug #4590: addQueryString will use QUERY_STRING, which might not be correct

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Wed Sep 12 12:15:50 CEST 2007


Ernesto Baschny [cron IT] schrieb:
> Hi,
> 
> this is a SVN patch request.
> 
> Branch: trunk
> 
> 
> Problem:
> With typolink's addQueryParams = 1 we expect it to work exactly like
> with .method = GET. This is not the case, as it will work directly with
> QUERY_STRING, which might not be correctly set after transformations in
> the URL have been made. For example RealURL will only set _GET, and
> leave QUERY_STRING untouched, which I think is ok, as one might want to
> work with the "real" QUERY_STRING.
> 
> So for example a site with tt_news and a setup with RealURL which hides
> tt_news _GET parameters in the URL, one cannot make a "print link" with
> this TypoScript:
> 
> temp.print_url = TEXT
> temp.print_url {
> 	typolink {
> 		returnLast = url
> 		addQueryString = 1
> 		parameter.data = TSFE:id
> 		additionalParams = &print=1
> 	}
> }
> 
> This will ignore all _GET parameters which were transformed by RealURL.
> 
> Solution in TypoScript is to always include
> 
> 		addQueryString.method = GET
> 
> but then the default solution is useless. So...
> 
> 
> Solution:
> Is to work only with _GET when adding parameters with addQueryParams.
> The "shortcut" to work with QUERY_STRING directly doesn't seem to
> provide any benefit.

The initial implementation used QUERY_STRING (note the name of the 
property) and so for compatibility reasons this had to be done like that 
and must stay so.

We could add a "addQueryParams" (in sync with "additionalParams") which 
only works with _GET/_POST defaulting to _GET and deprecate 
"addQueryString". Or should it be "passOnQueryParams" to reflect the fact 
that the current paramters are passed to the link? Or maybe we could name 
it "...Parameters" to be forward compatible with TYPO3 5.0.

Masi


More information about the TYPO3-team-core mailing list