[development] $_REQUEST/$_COOKIE scope in URLs?

Richard Morse remorse at partners.org
Mon Nov 5 15:01:56 UTC 2007


On Nov 5, 2007, at 5:07 AM, J-P Stacey wrote:

> Hi Richard,
>
>> You can click on the various columns to change the sort order. If  
>> the REQUEST is not serialized into the URL when the links to sort  
>> the table columns are created by theme_table, when you click no a  
>> column heading to resort the table, suddenly your search is  
>> abandoned.
>
> OK. $_REQUEST seems a weird place to store attributes of a results  
> table, but at least that explains why the serialization is  
> happening, if that's the accepted way of doing it. I suppose it's  
> no weirder than the use to which I'm putting the same scope. Maybe  
> I should switch all my request-persistent storage to $GLOBALS, like  
> almost everything else...!

I'm not putting attributes of a results table into $_REQUEST, I'm  
keeping track of what the current $_REQUEST is. The idea is that you  
specify "show me all users with a last name containing the string  
'Smith'". This gets sent (using a GET form) as something like  
"q=site_user_list&fields=last_name&string=Smith". It displays a list  
of all the users with a last_name field of 'Smith', and has columns  
which you can sort on. If $_REQUEST is not serialized back into the  
URL automatically in tablesort_get_querystring(), the URL that the  
column headers would go to would be things like  
"q=site_user_list&sort=last_name&order=desc",  
"q=site_user_list&sort=first_name&order=desc", etc, instead of what  
they should have:  
"q=site_user_list&fields=last_name&string=Smith&sort=last_name&order=des 
c", etc. So if $_REQUEST wasn't serialized back into the URL, when  
you tried to change the sort order of the display, the parameters  
that restrict what is being shown would be lost. I imagine that's  
also the reason this is done for pager_get_querystring().

Ricky


The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this information in error, please contact the Compliance HelpLine at 800-856-1983 and properly dispose of this information.


More information about the development mailing list