summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2012-06-12 10:32:30 -0400
committerDavid Rothstein <drothstein@gmail.com>2012-06-12 10:32:30 -0400
commit121b3483948266497368ba7ced10ff9a600f84dd (patch)
treecbbb0b0b92b45d16a7bfd0f826e857b02d040af3 /includes
parentd072581b8922d3b9dee978e59ebd5fcb6e54b93e (diff)
downloadbrdo-121b3483948266497368ba7ced10ff9a600f84dd.tar.gz
brdo-121b3483948266497368ba7ced10ff9a600f84dd.tar.bz2
Issue #1591726 by sun, tim.plunkett: Fixed Missing form_id, form_build_id, and form_token when using custom #parents and #tree = TRUE on $form itself.
Diffstat (limited to 'includes')
-rw-r--r--includes/form.inc12
1 files changed, 12 insertions, 0 deletions
diff --git a/includes/form.inc b/includes/form.inc
index a86510e05..bea4914b0 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -977,6 +977,10 @@ function drupal_prepare_form($form_id, &$form, &$form_state) {
'#value' => $form['#build_id'],
'#id' => $form['#build_id'],
'#name' => 'form_build_id',
+ // Form processing and validation requires this value, so ensure the
+ // submitted form value appears literally, regardless of custom #tree
+ // and #parents being set elsewhere.
+ '#parents' => array('form_build_id'),
);
// Add a token, based on either #token or form_id, to any form displayed to
@@ -1000,6 +1004,10 @@ function drupal_prepare_form($form_id, &$form, &$form_state) {
'#id' => drupal_html_id('edit-' . $form_id . '-form-token'),
'#type' => 'token',
'#default_value' => drupal_get_token($form['#token']),
+ // Form processing and validation requires this value, so ensure the
+ // submitted form value appears literally, regardless of custom #tree
+ // and #parents being set elsewhere.
+ '#parents' => array('form_token'),
);
}
}
@@ -1009,6 +1017,10 @@ function drupal_prepare_form($form_id, &$form, &$form_state) {
'#type' => 'hidden',
'#value' => $form_id,
'#id' => drupal_html_id("edit-$form_id"),
+ // Form processing and validation requires this value, so ensure the
+ // submitted form value appears literally, regardless of custom #tree
+ // and #parents being set elsewhere.
+ '#parents' => array('form_id'),
);
}
if (!isset($form['#id'])) {