diff options
author | Gerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org> | 2006-02-27 14:46:49 +0000 |
---|---|---|
committer | Gerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org> | 2006-02-27 14:46:49 +0000 |
commit | 539994e29c1c44124fe6c7c0cd99f7c4ef1fa95a (patch) | |
tree | 5e1f2008862f55c6d1de5b345fdb13cc67602fb6 | |
parent | 9bb285aafa7b3bfb667807c0d5e3526cc8f58dd6 (diff) | |
download | brdo-539994e29c1c44124fe6c7c0cd99f7c4ef1fa95a.tar.gz brdo-539994e29c1c44124fe6c7c0cd99f7c4ef1fa95a.tar.bz2 |
#43826, no way to suppress form_id, patch by wtanaka
-rw-r--r-- | includes/form.inc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/includes/form.inc b/includes/form.inc index c33ea6a36..83936eed0 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -49,7 +49,9 @@ function element_children($element) { * and then submit the form using drupal_submit_form(). * * @param $form_id - * A unique string identifying the form. Allows each form to be themed. + * A unique string identifying the form. Allows each form to be + * themed. Pass NULL to suppress the form_id parameter (produces + * a shorter URL with method=get) * @param $form * An associative array containing the structure of the form. * @param $callback @@ -70,7 +72,9 @@ function drupal_get_form($form_id, &$form, $callback = NULL) { $form['form_token'] = array('#type' => 'hidden', '#default_value' => md5(session_id() . $form['#token'] . variable_get('drupal_private_key', ''))); } - $form['form_id'] = array('#type' => 'hidden', '#value' => $form_id); + if (isset($form_id)) { + $form['form_id'] = array('#type' => 'hidden', '#value' => $form_id); + } if (!isset($form['#id'])) { $form['#id'] = $form_id; } |