You are here

function _patterns_validate_form in Patterns 7.2

Same name and namespace in other branches
  1. 6.2 patterns.module \_patterns_validate_form()
  2. 6 patterns.module \_patterns_validate_form()
  3. 7 includes/unused.inc \_patterns_validate_form()

Custom implementation of drupal_validate_form()

Removed static variable that prevented same form_id to be validated more then once during a single page request

1 call to _patterns_validate_form()
_patterns_process_form in includes/unused.inc
Custom implementation of drupal_process_form()

File

includes/unused.inc, line 92
Functions that are unused at the moment.

Code

function _patterns_validate_form($form_id, $form, &$form_state) {

  // If the session token was set by drupal_prepare_form(), ensure that it
  // matches the current user's session.
  if (isset($form['#token'])) {
    if (!drupal_valid_token($form_state['values']['form_token'], $form['#token'])) {

      // Setting this error will cause the form to fail validation.
      form_set_error('form_token', t('Validation error, please try again. If this error persists, please contact the site administrator.'));
    }
  }
  _form_validate($form, $form_state, $form_id);
}