When a form is submitted, drupal_process_form() will clear the form's cache if form_get_errors() returns nothing. It will also rebuild the cache while there are no errors.
Between clearing and rebuilding the cache, all form submit handlers are called. If a form generates errors during the submit handler and not the validate handler, then the form's cache is never rebuilt.
If a user then attempts to use any AJAX functionality on the form, it will fail due to a security check inside ajax_get_form(), which requires the form cache to exist.
drupal_process_form() should allow the form's cache to be rebuilt when there are errors generated by a submit handler and $form_state['cache'] is set to TRUE.
Comments
Comment #2
ruscoe commented