summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-12-19 14:43:42 +0000
committerDries Buytaert <dries@buytaert.net>2005-12-19 14:43:42 +0000
commit4f13fbb709a58c67565850423e5e1c0d7a11628b (patch)
tree28f157d382ec17b0094dcf6b1479c4a78b1d176d
parenteb412f7c7e15a8bd4e572d28e12ecaab59a7c0f7 (diff)
downloadbrdo-4f13fbb709a58c67565850423e5e1c0d7a11628b.tar.gz
brdo-4f13fbb709a58c67565850423e5e1c0d7a11628b.tar.bz2
- Patch #41023 by wtanaka: custom form elements can't cleanly set a value for themselves.
-rw-r--r--includes/form.inc9
1 files changed, 7 insertions, 2 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 300b78267..0f5ce2961 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -279,8 +279,6 @@ function _form_builder($form_id, $form) {
$form_submitted = $form_submitted || $form['#form_submitted'];
}
}
-
- $ref = $form['#value'];
}
// Allow for elements to expand to multiple elements. Radios, checkboxes and files for instance.
@@ -294,6 +292,13 @@ function _form_builder($form_id, $form) {
$form['#processed'] = TRUE;
}
+ // Set the $form_values key that gets passed to validate and submit.
+ // We call this after #process gets called so that #process has a
+ // chance to update #value if desired.
+ if ($form['#input']) {
+ $ref = $form['#value'];
+ }
+
// Recurse through all child elements.
$count = 0;
foreach (element_children($form) as $key) {