We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
required
For example if I want to make gender or some other field field as select box and have 0 value for male and 1 for female.
0
1
Because of bug I can't set gender field as required, because male selection doesn't pass required validation.
male
https://github.com/in2code-de/femanager/blob/develop/Classes/Domain/Validator/AbstractValidator.php#L58 It's because empty($var) function return false if $var = 0 or $var = '0'
empty($var)
false
$var = 0
$var = '0'
So I think something like this will solve the issue
protected function validateRequired($value) { if (!is_object($value)) { if (is_numeric($value)) { return true; } return !empty($value); } elseif (count($value)) { return true; } return false; }
The text was updated successfully, but these errors were encountered:
Allow '0' if field is required
c2a9d25
As 0 is a value, and not nothing. Relates: #52
this will be in the next release.
Sorry, something went wrong.
sbusemann
No branches or pull requests
For example if I want to make gender or some other field field as select box and have
0
value for male and1
for female.Because of bug I can't set gender field as required, because
male
selection doesn't passrequired
validation.https://github.com/in2code-de/femanager/blob/develop/Classes/Domain/Validator/AbstractValidator.php#L58
It's because
empty($var)
function returnfalse
if$var = 0
or$var = '0'
So I think something like this will solve the issue
The text was updated successfully, but these errors were encountered: