Index: includes/form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.396 diff -u -p -r1.396 form.inc --- includes/form.inc 8 Nov 2009 19:53:19 -0000 1.396 +++ includes/form.inc 9 Nov 2009 04:21:46 -0000 @@ -1809,6 +1809,8 @@ function form_process_password_confirm($ '#value' => empty($element['#value']) ? NULL : $element['#value']['pass2'], '#required' => $element['#required'], '#attributes' => array('class' => array('password-confirm')), + // Don't display error again since it is a duplicate of pass1. + '#no_error_label' => TRUE, ); $element['#element_validate'] = array('password_confirm_validate'); $element['#tree'] = TRUE; @@ -2742,7 +2744,8 @@ function theme_file($variables) { * @param $variables * An associative array containing: * - element: An associative array containing the properties of the element. - * Properties used: #title, #description, #id, #required, #children + * Properties used: #type, #name, #title, #description, #id, #required, + * #no_error_label, #value, #children * * @return * A string representing the form element. @@ -2766,10 +2769,10 @@ function theme_form_element($variables) $output = '
' . "\n"; $required = !empty($element['#required']) ? theme('form_required_marker', array('element' => $element)) : ''; $error = ''; - if (!empty($element['#required']) && empty($element['#value'])) { + if (!empty($element['#required']) && empty($element['#value']) && empty($element['#no_error_label'])) { $error = form_get_error($element) ? '' . $t('Field is required.') . '' : ''; } - else { + elseif (empty($element['#no_error_label'])) { $error = form_get_error($element) ? '' . filter_xss_admin(form_get_error($element)) . '' : ''; }