Hello all,

I am working on a multi-step form that consists of two steps. Step 1 will be to allow the user to choose a CSV file to upload and read some data from, and Step 2 will present the parsed data and allow them to confirm that it looks OK before importing it into the database.

In my form builder function for step 2, I check for a file upload and process it if it exists, storing a serialized version of the data read in from the file into a hidden form element so that it may be passed along to Step 2. My form builder function accepts an optional form_values argument that Drupal is supposed to populate with the incoming submitted form values (if any).

This works fine for submitting step 1 - the form_values passed to my form builder function when it is building the step 2 form are correct. However, after submitting step 2, something weird happens: the form values given to my form builder function are *not* the actual ones coming off $_POST, but rather the *old* form values from step 1, which are somehow saved.

After reading through all the multi-step forms tutorials I could find, this does not seem like the correct behavior to me, and I have no idea how or why it is happening. Can anybody lend a hand?

Thanks,
Ben