From 577bfdc670c59e4f8e5ac3e2bdcf994e897f4f79 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Sun, 4 Nov 2012 14:18:03 -0500 Subject: Issue #1414510 by andypost, Spleshka, perelman.yuval, tim.plunkett: Fixed Remove drupal_reset_static() for drupal_html_id() when form validation fails. --- includes/form.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/form.inc b/includes/form.inc index 826b6777b..fa49839e4 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -850,7 +850,10 @@ function drupal_process_form($form_id, &$form, &$form_state) { // cache when a form is processed, so scenarios that result in // the form being built behind the scenes and again for the // browser don't increment all the element IDs needlessly. - drupal_static_reset('drupal_html_id'); + if (!form_get_errors()) { + // In case of errors, do not break HTML IDs of other forms. + drupal_static_reset('drupal_html_id'); + } if ($form_state['submitted'] && !form_get_errors() && !$form_state['rebuild']) { // Execute form submit handlers. -- cgit v1.2.3