summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGábor Hojtsy2012-04-27 12:07:50 (GMT)
committer Gábor Hojtsy2012-04-27 12:07:50 (GMT)
commit09efe4f485dcaefd675782d17154511509b2c43c (patch)
tree01816cb743f666cee7f311b0ce9bc308644165a8
parent5f6ff3353b3869857cbe4b14ca9dbd2690d08fd2 (diff)
Issue #260934 by catch, ShawnClark, Jody Lynn, Island Usurper, joshmiller, anrikun, roychri, pdrake, Dave Cohen, sun, plach, bjaspan: When drupal_execute()ing multiple forms with same form_id in a page request, only the first one was validated.
-rw-r--r--includes/form.inc7
1 files changed, 6 insertions, 1 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 72c5e86..e6d2a6a 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -305,6 +305,11 @@ function drupal_execute($form_id, &$form_state) {
$form = call_user_func_array('drupal_retrieve_form', $args);
$form['#post'] = $form_state['values'];
+
+ // Reset form validation.
+ $form_state['must_validate'] = TRUE;
+ form_set_error(NULL, '', TRUE);
+
drupal_prepare_form($form_id, $form, $form_state);
drupal_process_form($form_id, $form, $form_state);
}
@@ -575,7 +580,7 @@ function drupal_prepare_form($form_id, &$form, &$form_state) {
function drupal_validate_form($form_id, $form, &$form_state) {
static $validated_forms = array();
- if (isset($validated_forms[$form_id])) {
+ if (isset($validated_forms[$form_id]) && empty($form_state['must_validate'])) {
return;
}