You are here

function form_test_storage_legacy_handler in Drupal 7

Emulate legacy AHAH-style ajax callback.

Drupal 6 AHAH callbacks used to operate directly on forms retrieved using form_get_cache and stored using form_set_cache after manipulation. This callback helps testing whether form_set_cache prevents resaving of immutable forms.

1 string reference to 'form_test_storage_legacy_handler'
form_test_menu in modules/simpletest/tests/form_test.module
Implements hook_menu().

File

modules/simpletest/tests/form_test.module, line 820
Helper module for the form API tests.

Code

function form_test_storage_legacy_handler($form_build_id) {
  $form_state = array();
  $form = form_get_cache($form_build_id, $form_state);
  drupal_json_output(array(
    'form' => $form,
    'form_state' => $form_state,
  ));
  $form['#poisoned'] = TRUE;
  $form_state['poisoned'] = TRUE;
  form_set_cache($form_build_id, $form, $form_state);
}