If the user reloads the page while using the form wizard example, the form reloads at the same step that they were on: this is correct behaviour.

However, it's easy to get this wrong, as shown by this core bug report: #1060290: Multi-step forms are prone to misbehave on refresh.

The key to doing this appears to be this code in the wizard step submit handler:

    if (!empty($form_state['step_information'][$current_step]['stored_values'])) {
      $form_state['values'] = $form_state['step_information'][$current_step]['stored_values'];
    }

This could do with a comment to explain how it's crucial to this behaviour, so that people who's wizard is not behaving correctly can easily identify what they're doing wrong.

Comments

Mile23’s picture

Version: 8.x-1.x-dev » 7.x-1.x-dev

The code in the summary refers to the 7.x-1.x branch.

jungle’s picture

Status: Active » Closed (outdated)

No activity for over 5 years. I am closing this. Please feel free to reopen if necessary.

Thanks!