data['needed_files']) && is_array($options_cache->data['needed_files']) ? $options_cache->data['needed_files'] : array(); asaf_load_needed_files($form_state['build_info']['files']); if (isset($_POST['asaf_form_path'])) { $form_state['asaf']['form_path'] = $_POST['asaf_form_path']; } if (isset($_POST['asaf_id_prefix'])) { $form_state['asaf']['id_prefix'] = $_POST['asaf_id_prefix']; } // For asaf owns forms, which has asaf security token, rebuild form if it // doesn't have cache. It allows asaf works when page cache is enabled. $form = drupal_build_form($_POST['form_id'], $form_state); } else { // 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(); } } // Since some of the submit handlers are run, redirects need to be disabled. $form_state['no_redirect'] = TRUE; // When a form is rebuilt after Ajax processing, its #build_id and #action // should not change. // @see drupal_rebuild_form() $form_state['rebuild_info']['copy']['#build_id'] = TRUE; $form_state['rebuild_info']['copy']['#action'] = TRUE; // The form needs to be processed; prepare for that by setting a few internal // variables. $form_state['input'] = $_POST; $form_id = $form['#form_id']; return array($form, $form_state, $form_id, $form_build_id); }