-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
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
Fix number field setter #1970
base: 1.x
Are you sure you want to change the base?
Fix number field setter #1970
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Do data type casting from String to either int or float.
d9eadac
to
e94c4f4
Compare
The tests failed, are there some sort of linting rules? |
Spotted that, pushed a quick patch which should sort it, it was due to |
@@ -54,7 +54,7 @@ public function setValue($value) | |||
throw new FieldTypeException(self::class.' value must be numeric.'); | |||
} | |||
|
|||
$this->value = $value; | |||
$this->value = $value ? $value + 0 : ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does returning '' solve the initial issue?
will setting type hint to property/return/argument solve the issue?
Do data type casting from String to either int or float.
This should fixes #1969.