The documentation says that any extra arguments fed to drupal_get_form are passed on to the form constructor. After some testing and looking at the source, that appears to only happen in the multistage form case.

Comments

kbahey’s picture

Project: Drupal.org infrastructure » Drupal core
Version: » 6.x-dev
Component: Other » documentation

Changing that to be a documentation issue, not infrastructure.

merlinofchaos’s picture

Status: Active » Closed (won't fix)

1) the documentation is not specific. You need to reference a specific piece of documentation, unless you assume that there's anyone who actually has the entirely of drupal documentation memorized and knows exactly where a given piece is.

2) If you're referring to api.drupal.org documentation, that documentation is generated from code comments by api.module, and would be a bug against the code itself.

3) I think you're wrong. Those arguments do always get passed on (unless the form was retrieved from cache, anyhow) This feature is critical, and it does work, or a LOT of forms in Drupal core would completely fail. Here is the relevant code:

      $args_temp = $args;
      $args_temp[0] = &$form_state;
      array_unshift($args_temp, $form_id);

      $form = call_user_func_array('drupal_retrieve_form', $args_temp);

drupal_retrieve_form() then goes on to do some processing and passes those args through:

  $form = call_user_func_array(isset($callback) ? $callback : $form_id, $args);

This happens whether or not the form is multistage (in fact, there isn't really an explicit multistage form case anymore).