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

ruscoe created an issue. See original summary.

ruscoe’s picture

Assigned: ruscoe » Unassigned
Status: Active » Needs review
StatusFileSize
new914 bytes

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.