diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-05-16 10:11:19 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-05-16 10:11:19 +0000 |
commit | be7bb9be9bb41c83795fa8d7fa119ce4025f2de0 (patch) | |
tree | 08baad50a4d94477ccd31aefd7a9d8cba5691bf8 | |
parent | 3d38b57220a6302f34d31b332c1b680569493ab9 (diff) | |
download | brdo-be7bb9be9bb41c83795fa8d7fa119ce4025f2de0.tar.gz brdo-be7bb9be9bb41c83795fa8d7fa119ce4025f2de0.tar.bz2 |
- Patch #63704 by chx: fixed the order of validation. (Needs more wide-spread testing before being backported to DRUPAL-4-7.)
-rw-r--r-- | includes/form.inc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/includes/form.inc b/includes/form.inc index 310270112..5e75326ff 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -197,6 +197,12 @@ function drupal_submit_form($form_id, $form, $callback = NULL) { } function _form_validate($elements, $form_id = NULL) { + // Recurse through all children. + foreach (element_children($elements) as $key) { + if (isset($elements[$key]) && $elements[$key]) { + _form_validate($elements[$key]); + } + } /* Validate the current input */ if (!$elements['#validated']) { if (isset($elements['#needs_validation'])) { @@ -246,13 +252,6 @@ function _form_validate($elements, $form_id = NULL) { } $elements['#validated'] = TRUE; } - - // Recurse through all children. - foreach (element_children($elements) as $key) { - if (isset($elements[$key]) && $elements[$key]) { - _form_validate($elements[$key]); - } - } } /** |