I'm having a problem displaying a cached multi-step form in a custom module which generates custom entities.
- After two steps, the form posts to an external URL (action changed with hook_form_form_id_alter).
- If the external URL returns errors, the form is pulled from cache with form_get_cache() and displayed using drupal_render().
- Form displays okay, but field elements are missing name and value attributes.
Printing the form object retrieved from cache shows expected values (#entity, fields, and user input associated with fields).
$form_state = array( 'submitted' => FALSE, 'rebuild' => FALSE, 'cache' => TRUE, ); $form = form_get_cache($form_build_id, $form_state); $output = drupal_render($form);
I suspect that I need to rebuild $form_state input/values or am missing a form rebuild step.