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

NumericField doesn't valid properly numbers > 1000 with locale fr-Fr #11162

Closed
2 tasks done
lekoala opened this issue Mar 1, 2024 · 3 comments
Closed
2 tasks done

NumericField doesn't valid properly numbers > 1000 with locale fr-Fr #11162

lekoala opened this issue Mar 1, 2024 · 3 comments

Comments

@lekoala
Copy link
Contributor

lekoala commented Mar 1, 2024

Module version(s) affected

5.1.x

Description

Because the length of the strength is checked, the numeric values with a narrow non breakable spaces as produced by the NumberFormatter class will fail to valid properly

How to reproduce

  • set locale to fr_FR
  • input a number >= 1000
  • without space, it works
  • it's the formatted on display with a narrow non breakable spaces
  • if you try to save again, it fails
image

Possible Solution

  • don't check the strlen as a way to validate parsing works
  • replace narrow non breakable spaces by regular spaces

Additional Context

No response

Validations

  • Check that there isn't already an issue that reports the same bug
  • Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)

PRs

lekoala added a commit to lekoala/silverstripe-framework that referenced this issue Mar 1, 2024
@lekoala lekoala changed the title NumericField doesn't valid properly numbers > 1000 with locale fr-F NumericField doesn't valid properly numbers > 1000 with locale fr-Fr Mar 1, 2024
@lerni
Copy link
Contributor

lerni commented Mar 1, 2024

See also #10626

@lekoala
Copy link
Contributor Author

lekoala commented Mar 1, 2024

@lerni ouch, i see nobody took care of that for ages ^^
my approach is really simple and should fix it for everyone

@GuySartorelli
Copy link
Member

PR merged. This will be automatically tagged by GitHub actions

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

No branches or pull requests

3 participants