I use a contact form that has 2 categories, selecting one of these categories displays the relevant fields using an AJAX request. Problem is with Botcha activated, the AJAX request does not work.

There are no javascript errors, just the AJAX request executed and no fields displayed.
The log messages says: "Ajax - Invalid form POST data. - Warning".

Comments

hles’s picture

Error generated here in ajax_get_form() in ajax.inc:

  // Get the form from the cache.
  $form = form_get_cache($form_build_id, $form_state);
  if (!$form) {
    // If $form cannot be loaded from the cache, the form_build_id in $_POST
    // must be invalid, which means that someone performed a POST request onto
    // system/ajax without actually viewing the concerned form in the browser.
    // This is likely a hacking attempt as it never happens under normal
    // circumstances, so we just do nothing.
    watchdog('ajax', 'Invalid form POST data.', array(), WATCHDOG_WARNING);
    drupal_exit();
  }

Well, of course, forcing $form_state['no_cache'] = FALSE; for the form using AJAX will fix the problem, but I have no clue what it implies in the logic behind the module.

hles’s picture

Title: Botcha breaks ajax in forms » Forms using AJAX callbacks won't work with Botcha enabled.

Changing title

iva2k’s picture

Status: Active » Closed (duplicate)

Seems to be a duplicate of #1270986: Make BOTCHA work with AJAX.