Not sure why this happens, but I've modified a webform to submit the form on the last page of the webform only. However, when a user clicks the "Previous page" button, it also fires the Ajax submit hook even though it shouldn't be. I spent a few hours trying to figure it out, but couldn't for the life of me determine why (the button wasn't getting the class that should have caused it to fire). Ultimately, I made the following fix in ajax.module:

function ajax_submitter(&$form, &$form_state) {
  // Only fire on ajax.
  if (!isset($_POST['drupal_ajax'])) {
    return;
  }
  $messages = drupal_get_messages(NULL, TRUE);

This fixed the issue. Sorry for not creating a patch, but I figured that is easy enough for you.

Comments

brendoncrawford’s picture

Status: Active » Needs work