[development] Temporary form data storage ... and avoiding validation

James Gilliland neclimdul at gmail.com
Wed Aug 11 21:33:25 UTC 2010


  On 08/11/2010 05:29 AM, Daniel F. Kudwien wrote:
>>> Is form_state going to persist the user data for me
>>> between form loads, or is there a better method?
> ...
There might be a better method. Some people suggested _SESSION which is 
pretty handy for little bits of data but I'd checkout ctools' 
object_cache. Or better yet, since you're creating a form that keeps 
state, maybe ctools' wizard form generator is what you're looking for. 
It can do some pretty handy stuff and is well tailored for use with 
ctools' object_cache.
> Your shopping cart use-case sounds like $_SESSION or a dedicated table keyed
> by session ID and uid to me.  Also not sure why you want to reinvent the
> wheel -- doesn't Ubercart or eCommerce or anything else in contrib contain a
> ready Cart module already?
>
> sun
>
He did say "like a shopping cart" so I assume it was only an example. 
Using a prebuilt and tested module is always a big win though.

--
James Gilliland


More information about the development mailing list