[TYPO3-dev] Bug/Feature request for t3lib_div::_GP (and alike)

Martin Kutschker martin.kutschker-no at spam-blackbox.net
Thu Jun 12 17:30:46 CEST 2008


Franz Koch schrieb:
> Hey Steffen,
> 
>> Franz want to have $_REQUEST
>> but in this case it's not necessary Franz, because you look for a 
>> single parameter/key/subkey
>>
>> So if this subkey is in POST, you get the value, or not in POST but in 
>> GET you get the value from there.
> 
> That's the point - I don't get it from GET if there is also a parameter 
> with the same namespace in POST.
> 
> My use case:
> 
> I'm using your extension skpagecomments and attached it via TS on every 
> page in a toolbar at the bottom of the website, only displaying the 
> button 'show comments (n)' by default. When you click the button and 
> submit the piVar tx_skpagecomments_pi1[showComments] with GET, I want to 
> hide/remove the button from the bottom toolbar and show the comments 
> with a comment form right above the toolbar. Therefore I use a 
> condition, checking for this piVar and set/unset TS-objects accordingly. 
> I use this condition:
> [globalVar = GP:tx_skpagecomments_pi1|showComments = 1]
> 
> This is working fine, unless I try to add a comment. When submitting the 
> comment form, the condition will fail and the comments get shown inside 
> the toolbar instead above.
> 
> And this is because t3lib_div::_GP is not returning a merged array to 
> the matchcondition class.
> 
> Ok, now I know that I can check directly for a GET var, but I'd like to 
> stay a bit more flexible so that I don't need to care if the parameter 
> is coming from GET or POST.

But your description of the use case still requires only one value. The 
point is that for _GP POST takes precedence, but you want it to be GET. 
That's all.

In t3lib_div::_GP() we could easily add a paramter that reverses the 
precedence.

For TS conditions I suggest to swap the letters to PG:

[globalVar = PG:tx_skpagecomments_pi1|showComments = 1]

The naming logis is that the last letter will be the final one to decide 
which value is returned.

Masi




More information about the TYPO3-dev mailing list