Bug 37143: Do not allow required fields with only whitespace to be submitted
To test:
1. Make some fields for OPAC self registration required.
2. Create a new patron via self reg.
3. Fill out those required fields as an empty string like " ".
4. Submit the form, it succeeds.
5. APPLY PATCH, restart_all
6. Try again. Required fields with only whitespace are treated as if they were empty.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit 12426b5924)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
This commit is contained in:
parent
d6f529c38c
commit
01df1563bf
|
|
@ -462,7 +462,7 @@ sub CheckMandatoryFields {
|
|||
|
||||
foreach my $key ( keys %$mandatory_fields ) {
|
||||
push( @empty_mandatory_fields, $key )
|
||||
unless ( defined( $borrower->{$key} ) && $borrower->{$key} );
|
||||
unless ( defined( $borrower->{$key} ) && $borrower->{$key} && $borrower->{$key} !~ /^\s*$/ );
|
||||
}
|
||||
|
||||
return @empty_mandatory_fields;
|
||||
|
|
|
|||
Loading…
Reference in New Issue