Skip to content
Snippets Groups Projects
Commit 539994e2 authored by Gerhard Killesreiter's avatar Gerhard Killesreiter
Browse files

#43826, no way to suppress form_id, patch by wtanaka

parent 9bb285aa
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -49,7 +49,9 @@ function element_children($element) { ...@@ -49,7 +49,9 @@ function element_children($element) {
* and then submit the form using drupal_submit_form(). * and then submit the form using drupal_submit_form().
* *
* @param $form_id * @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 * @param $form
* An associative array containing the structure of the form. * An associative array containing the structure of the form.
* @param $callback * @param $callback
...@@ -70,7 +72,9 @@ function drupal_get_form($form_id, &$form, $callback = NULL) { ...@@ -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_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'])) { if (!isset($form['#id'])) {
$form['#id'] = $form_id; $form['#id'] = $form_id;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment