fixed: SQL Form fields with a regex are required even if not set to required
This commit is contained in:
parent
da5877eb3d
commit
a34025fbc9
2 changed files with 3 additions and 1 deletions
|
|
@ -2763,7 +2763,8 @@ my $cmd = '$self->session->form->'.$field->{formFieldType}.'($fieldName)';
|
|||
}
|
||||
|
||||
# Check if input matches its regex
|
||||
if (_matchField($self, $self->session->form->process($fieldName), $field->{regex})) {
|
||||
if ($self->session->form->process($fieldName) eq '' && !$field->{isRequired} ||
|
||||
_matchField($self, $self->session->form->process($fieldName), $field->{regex})) {
|
||||
push(@update, "$fieldName = ".$self->session->db->quote($fieldValue));
|
||||
} else {
|
||||
push(@error, $i18n->get('ers regex mismatch').' '.$regexes{$field->{regex}}.' '.$field->{displayName});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue