The forms_validate function fires even when a field is not marked as required and is empty. This effectively makes all fields with validation also required. Need to fix either the regex in common.inc or the wrapper function.
This should fix it in forms.module:
if ($func = $field->validation) {
+ if ($edit[$field->name]) {
$func = 'valid_' . $func;
if (function_exists($func) && !$func($edit[$field->name])) {
form_set_error($field->name, t('Invalid entry for %field', array('%field' => '<em>' . $field->title . '</em>')));
$error = true;
}
+ }
}
Comments
Comment #1
dtan commentedpatch here: http://drupal.org/node/22707