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

Cannot create Customer with Date of Birth in Magento 2.1 (en_GB locale) #6323

Closed
JacobDrummond opened this issue Aug 24, 2016 · 11 comments
Closed
Labels
bug report Component: Customer Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Release Line: 2.1 Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release

Comments

@JacobDrummond
Copy link

Environment

  1. Apache 2.4.17
  2. MySQL 5.0.11-dev
  3. PHP 5.6.15
  4. Magento 2.1.0

Steps to reproduce

  1. In System > All Users > User > [You], set the interface locale to English (United Kingdom):
    blog-3
  2. Create a new customer. Make sure to fill in Date of Birth field:
    c-1
  3. Save Customer

Expected result

  1. Customer saves without error

Actual result

  1. "Invalid date" exception thrown:
    c-2
  2. Trying to save the new customer again results in a JS validation error:
    c-3

Cause

  • The culprit is Date::inputFilter()
  • In my case, Date::inputFilter() accepts 08/24/2016 and returns 0,8/2,4/2,016
  • 0,8/2,4/2,016 is not a real date in any locale, causing an exception to be thrown.

General locale issues in Magento 2.1

  • Changing admin locale from en_US to en_GB causes PHP date formats to change, but not JS date formats.
  • In the above example, the JS datepicker populated the field with 08/24/2016, despite the entire UI being in en_GB.
@JacobDrummond JacobDrummond changed the title Saving Customer with Date of Birth throws exception in Magento 2.1 Cannot create Customer with Date of Birth in Magento 2.1 (en_GB locale) Aug 24, 2016
@sevos1984
Copy link
Contributor

Internal ticket created MAGETWO-57835, thanks for reportng

@sevos1984 sevos1984 added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Aug 30, 2016
@sevos1984 sevos1984 assigned sevos1984 and unassigned sevos1984 Aug 30, 2016
mmansoor-magento pushed a commit that referenced this issue Sep 26, 2016
mmansoor-magento pushed a commit that referenced this issue Sep 26, 2016
mmansoor-magento pushed a commit that referenced this issue Sep 26, 2016
[South] Bugfixes
- MAGETWO-58277 Saving category on catalog with 20k+ products is very slow (from 5mins till 1 hour)
- MAGETWO-23764 Category/Product Indexer fails with mysql fatal on large catalog
- MAGETWO-33568 Customer is redirected to "Compare Products" Frontend page if tries to remove a Product from comparing
- MAGETWO-56512 Products created via REST API are not visible after enabling the product via scope = All Store Views
- MAGETWO-55154 [GitHub] IndexerHandlerFactory: Indexer Object cast to String
- MAGETWO-57835 [Github] Cannot save customer dob attribute if admin interface locale is en_GB #6323
- MAGETWO-57629 ACL not used on grid quick edits
@slavvka
Copy link
Member

slavvka commented Sep 26, 2016

The issue has been fixed and delivered to develop.

@slavvka slavvka closed this as completed Sep 26, 2016
@JacobDrummond
Copy link
Author

@slavvka, thanks! :)

@sopedro
Copy link

sopedro commented Apr 28, 2017

In frontend the date works well, the issue is just in backend and with all dates. The reports don't work too.

@JacobDrummond
Copy link
Author

@sopedro, Magento2 admin locale is a mess. See, for example, #7888, #9426, #8849.

These, and similar issues, are widely-reported but development seems to slow.

@ishakhsuvarov ishakhsuvarov reopened this May 10, 2017
@vherasymenko
Copy link

Steps to reproduce:

  1. Install Magento latest develop version.
  2. Go to Admin side
  3. System > All Users
  4. Choose your user, then set Interface local to United Kingdom
  5. Click "Save"
  6. Click "Customers > All customers"
  7. Click "Add new"
  8. Fill all required fields
  9. Choose birthday date "Today"
  10. In email field enter already existed email address
  11. Click "Save"
  12. After error change email on non existing and click "Save"

AR: Displayed error about incorrect date
ER: Customer should be saved

Note: but after first saving date changed on other date automatically.

@Emadis
Copy link

Emadis commented Jun 10, 2017 via email

@nitin700
Copy link

@Emadis Thanks for the information.

magento-team pushed a commit that referenced this issue Jul 5, 2017
magento-team pushed a commit that referenced this issue Jul 5, 2017
…nterface locale is en_GB #6323

- MAGETWO-70327
- functional test
magento-team pushed a commit that referenced this issue Jul 5, 2017
…nterface locale is en_GB #6323

- add ability for filtering by time
magento-team pushed a commit that referenced this issue Jul 5, 2017
magento-team pushed a commit that referenced this issue Jul 5, 2017
magento-team pushed a commit that referenced this issue Jul 5, 2017
magento-team pushed a commit that referenced this issue Jul 5, 2017
magento-team pushed a commit that referenced this issue Jul 5, 2017
magento-team pushed a commit that referenced this issue Jul 5, 2017
MAGETWO-69029: Remove obsolete link "Show more" on Dashboard page on Advance Reporting block
MAGETWO-60352: [Github] Wrong error message in cart after entering invalid discount code #7230
MAGETWO-66510: Javascript error prevents adding/removing categories from existing catalog price rule condition
MAGETWO-59207: Checkbox return to stock doesn't work if Automatically Return Credit Memo Item to Stock Yes
MAGETWO-70201: Update Readme for Analytics modules. Final
MAGETWO-57835: [Github] Cannot save customer dob attribute if admin interface locale is en_GB #6323
@veloraven veloraven marked this as a duplicate of #10233 Jul 24, 2017
@magento-engcom-team magento-engcom-team added Release Line: 2.1 Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Component: Customer develop Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Sep 11, 2017
@magento-engcom-team magento-engcom-team added 2.0.x Fixed in 2.2.x The issue has been fixed in 2.2 release line labels Sep 20, 2017
@magento-engcom-team
Copy link
Contributor

@JacobDrummond, thank you for your report.
The issue is already fixed in 2.2.0

@magento-engcom-team magento-engcom-team added the Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release label Sep 20, 2017
@danharper83
Copy link

Still a issue for 2.2.3

Trying to set "Set Product as New From"

Message "Invalid input datetime format of value '31/05/2018"

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

No branches or pull requests