简体   繁体   中英

Concurrently filling in drupal forms on different computers mixes up form_state data of the different computers

I'm having a very difficult problem atm, one that I can not explain... at all. I really hope someone here may be able to shed some light on this predicament.

On my website I have a self-developed module that displays some kind of registration form. The registration form consists of different parts:

  1. Personal information
  2. Educational Information
  3. Linguistic Skills
  4. Local/Exchange Specific information
  5. Some optional additional remarks.

Using AHAH and the AHAH Helper module I have created (read: programmed) this form to be 'multipage'. It has the header on top describing what part of the total registration you are currently in, and which parts you have yet to complete. You have a previous/next button to navigate between the different pages of the form. This is all controlled by AHAH, and I keep track of the pages using a hidden form element with a default value 'current_page'. Anyway that is kind of besides the point.

The important part of the above explanation is that the data of all the different parts persists through the different pages by using the form_state variable. AHAH Helper keeps the previous values entered in the form saved in the 'storage' of the form_state.

Now some of the users seem to be experiencing the following problem upon registering: While they are filling in their information, and some AHAH call is triggered in the form (eg: Pressing the next button, Checking the email address for validity, checking birthdate for >= 17) after the AHAH call is finished, the values within the form elements, that had already been filled in, have been replaced by completely different values. A name of a different person, his age, his email address etc. Even though this person, I assume that this is what is happening, is filling out the form on a different, private computer, in obviously a different session.

My users do not have to login on the website in order to register using this page, I'm not sure if that is causing an issue?

Anyway, as far as I can tell, I can only recreate the problem when I try filling out the form with different data from different browsers on my computer, concurrently. In that case I can manage to corrupt the form_state data. But as the users are on different, private computers, which presumable use different sessions/cookies/what-not, how is it ever possible for form_state data to be changed to form_state data of another computer who is also filling out the form??

I don't get this? Is there some kind of inherent flaw in using AHAH (& AHAH Helper) for keeping the form_state? If there is, is there some kind of work around? Am I just making a huge newby mistake somewhere in my module code that prevents the form from working correctly?

Is there please, anybody, that can shed even a little bit of light at all on this problem? I am absolutely, and completely clue-less and I can not begin to imagine what is going wrong and how and even IF I can fix it at all. Please help me! :S

Thanks in advance!

Best Regards,

Tom

Edit: This problem describes a problem in drupal 6.x

I'm answering my own question after having found the solution (quite a while back, but I forgot about this question).

The problem is that the form_state for the different computers is kept apart using session information from drupal. However, this did not seem to work correctly with the AHAH forms for users that were not registered .

Having users register before being able to fill in these forms solved all the concurrency issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM