Skip to content
Snippets Groups Projects
Commit b0051893 authored by Steven Wittens's avatar Steven Wittens
Browse files

- #42083: Form API IP should be xhtml id of <form> tag

parent cebc8843
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
...@@ -71,6 +71,9 @@ function drupal_get_form($form_id, &$form, $callback = NULL) { ...@@ -71,6 +71,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); $form['form_id'] = array('#type' => 'hidden', '#value' => $form_id);
if (!isset($form['#id'])) {
$form['#id'] = $form_id;
}
$form = array_merge(_element_info('form'), $form); $form = array_merge(_element_info('form'), $form);
...@@ -847,7 +850,7 @@ function theme_textfield($element) { ...@@ -847,7 +850,7 @@ function theme_textfield($element) {
function theme_form($element) { function theme_form($element) {
// Anonymous div to satisfy XHTML compliancy. // Anonymous div to satisfy XHTML compliancy.
$action = $element['#action'] ? 'action="' . check_url($element['#action']) . '" ' : ''; $action = $element['#action'] ? 'action="' . check_url($element['#action']) . '" ' : '';
return '<form '. $action . ' method="'. $element['#method'] .'" '. drupal_attributes($element['#attributes']) .">\n<div>". $element['#children'] ."\n</div></form>\n"; return '<form '. $action . ' method="'. $element['#method'] .'" '. 'id="'. $element['#id'] .'"'. drupal_attributes($element['#attributes']) .">\n<div>". $element['#children'] ."\n</div></form>\n";
} }
/** /**
......
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