[development] Overriding function declared in another module

Steve Ringwood nevets at tds.net
Tue Jan 18 15:26:36 UTC 2011


Justin

     Not sure what you are referring to in the docs for hook_form_alter but here is the relavent code
     from form.inc, function drupal_prepare_form().

   $data = &$form;
   $data['__drupal_alter_by_ref'] = array(&$form_state);
   drupal_alter('form_'. $form_id, $data); << Form ID specific call

   // __drupal_alter_by_ref is unset in the drupal_alter() function, we need
   // to repopulate it to ensure both calls get the data.
   $data['__drupal_alter_by_ref'] = array(&$form_state);
   drupal_alter('form', $data, $form_id); << General call (hook_form_alter)

Nevets



More information about the development mailing list