Skip to content
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

Number fields don't throw errors when the value is not a number #4849

Closed
Anubarak opened this issue Aug 29, 2019 · 1 comment
Closed

Number fields don't throw errors when the value is not a number #4849

Anubarak opened this issue Aug 29, 2019 · 1 comment

Comments

@Anubarak
Copy link
Contributor

Description

The Number field as of now is a little bit confusing and I tend to use my custom Number field that actually validates numbers.
With the Feed Me fix here craftcms/feed-me#527 you included

return $value === '' || !is_numeric($value) ? null : $value;

which causes to convert inputs like "aa" to null, so the number Validator won't fire and the model is saved without errors. When the client doesn't pay attantion and wants to submit something he/she won't see an error and it's just saved as empty. I don't think thats any good

Steps to reproduce

  1. Create a Number field
  2. Insert a string
  3. See it's saved without errors but as null

Additional info

  • Craft version: 3.2.10
@brandonkelly
Copy link
Member

Agree that’s not great. We’ll have to fix the Feed Me bug at the source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants