You are here

function _patterns_validate_form in Patterns 6.2

Same name and namespace in other branches
  1. 6 patterns.module \_patterns_validate_form()
  2. 7.2 includes/ \_patterns_validate_form()
  3. 7 includes/ \_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 ./patterns.module
Custom implementation of drupal_process_form()


./patterns.module, line 3039
Enables extremely simple adding/removing features to your site with minimal to no configuration


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);