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

Invalid date when customer validate with French locale #9743

Closed
vjacquemin-sqli opened this issue May 23, 2017 · 11 comments
Closed

Invalid date when customer validate with French locale #9743

vjacquemin-sqli opened this issue May 23, 2017 · 11 comments
Labels
bug report Component: Customer Component: Translation Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@vjacquemin-sqli
Copy link

Preconditions

  1. Magento 2.1.5
  2. PHP 7
  3. MySQL 5.6

Steps to reproduce

  1. Set Backoffice to French locale : account settings ->language French (France)
  2. Modify a customer and set date of birthday (for example : 04/17/1973)

Expected result

  1. Customer validation with new DOB

Actual result

  1. Error message "Invalid date"

I found in Magento\Framework\Data\Form\Filter\Date class before line 65, the date value is okay, after the l.65, date value contains space chars. I think Zend_Filter_NormalizedToLocalized "filter" method insert spaces (as thousand separators). If I ignore this line, validation succeeds.

@gsomoza
Copy link
Contributor

gsomoza commented May 24, 2017

Maybe I misunderstood what you meant, but the string "04/17/1973" should NOT be a valid date in the FR_fr locale: France uses DMY for all-numerical dates. So if validation fails with "04/17/1973" then that's correct for the French locale.

@vjacquemin-sqli
Copy link
Author

@gsomoza : You're right. The right date should be 17/04/1973 (dd/mm/yyyy). But javascript validation fails if I input '17/04/1973' (I obtain an error under calendar "Enter a correct date"). That's another Magento2 bug I suppose.

However, if I input '04/17/1973', Javascript validation succeeds, but PHP response fails, and I notice that space has been inserted in my date (as I explained on my additionnal informations on the issue above).

@gsomoza
Copy link
Contributor

gsomoza commented May 24, 2017

Great, this is clear now, it indeed looks like a bug 👍

@VasylShvorak
Copy link
Contributor

@vjacquemin-sqli Thanks for reporting this issue. Created internal issue MAGETWO-70504 to investigate and track this issue.

@veloraven veloraven added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Jul 6, 2017
@samuelecarpene
Copy link

Same problem with Italian locale.

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Component: Customer Component: Translation Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed G1 Passed labels Sep 5, 2017
@joachimVT
Copy link

Working on this issue.

@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-80096

@magento-engcom-team
Copy link
Contributor

Hi @vjacquemin-sqli the issue has been fixed in #11067 by @joachimVT
The fix will be available in 2.2.1

@magento-engcom-team magento-engcom-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Oct 6, 2017
@digvijay2017
Copy link

This issue is fixed in 2.2.1. Thanks

@okorshenko
Copy link
Contributor

Hi @vjacquemin-sqli. Thank you for your report.
The issue has been fixed in magento-engcom/magento2ce#1353 by @magento-engcom-team in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

@tinbrandon
Copy link

This issue is still happening in Magento 2.4.6 when saving customer birth day in none english date format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Customer Component: Translation Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests