Commit be7bb9be authored by Dries's avatar Dries
Browse files

- Patch #63704 by chx: fixed the order of validation. (Needs more wide-spread...

- Patch #63704 by chx: fixed the order of validation.  (Needs more wide-spread testing before being backported to DRUPAL-4-7.)
parent 3d38b572
......@@ -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]);
}
}
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment