Monday, July 11, 2011

Visualize Backtrace seems to be interesting :

The drupal system composes a function name based on the form_id variable and the suffix of _validate, then it marks a bit as true in the form object, but does not store the whole function. This saves memory but would be slower than storing the function directly or wrapped in a call context in the hash, we can expect to call it later anyway.
if (!isset($form['#validate'])) {    if (function_exists($form_id .'_validate')) {      $form['#validate'] = array($form_id .'_validate');    }  }

later it does more checks,
    if (isset($elements['#needs_validation'])) 

This shows you that there are more callbacks available. .

This is the callback function for the submit,
 $function($form, $form_state);