Closed (fixed)
Project:
Chaos Tool Suite (ctools)
Version:
6.x-1.3
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
17 Feb 2010 at 12:12 UTC
Updated:
18 Feb 2010 at 10:47 UTC
Here is the context
$form_info = array (
'forms' = array(
'registration' => array (
'form id' => 'mymodule_choose_registration_form');
'personal-details' => array(
'form id' => 'mymodule_personal_details_form',
'summary' => array (
'form id' => 'mymodule_summary_form',
)
),
'order' = array(
'choose-registration' => 'Choose registration type',
'personal-details' => 'Enter your personal details',
'summary' => 'Summary',
),
...
);
...
function mymodule_summary_form(&$form, &$form_state) {
$options = array(
'registration' => 'Register another person',
'finish' => 'Go to payment page',
)
$form['next_task'] = array (
'#type' => 'radios',
'#options' => $options,
)
// output some text taken from the wizard model object (using ctools object cache)
// basically linsting the registered persons with their details
$form['summary_text'] => array('#value' => ... )
}
function mymodule_summary_form(&$form, &$form_state) {
// if $form_state['next_task'] = 'registration'
// Take the user to the registration form (the first form)
// otherwise normal finish flow
}
Every thing works as expected for logged in users. But for anonymous, the forms are cached and used for all anonymous requests.
So anonymous user 2 sees the summary_text of anonymous 1...And anonymous 1 sees a summary that does not include the latest registrations he added
When i tried using $form_state['storage], to stored the 'summary_text' but then drupal expects my form signature to be mymodule_summary_form(&$form_state) and not mymodule_summary_form(&$form, &$form_state)
I feel lost... any help with be much appreciated
Comments
Comment #1
redben commentedFor anyone having the same issue you can add the following code to your module to force drupal no to cache your wizard pages :
But if you have a nicer way of doing this i'm still interested
Thanks
Comment #2
redben commentedComment #3
merlinofchaos commentedAhh yes, another one bitten by anonymous page caching. I don't think there's much I can really do about that, except perhaps try to document this problem somewhere.
Comment #4
redben commentedMay be adding a "Caveats and workaround" section in the advanced help ?
I have created another issue http://drupal.org/node/718028 for adding this to documentation