Skip to content

#7778: Date of Birth attribute gets weird format on page reload #11748

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

Closed
wants to merge 1 commit into from

Conversation

nemesis-back
Copy link

@nemesis-back nemesis-back commented Oct 25, 2017

Bugfix for #7778 and #11721

Description

This PR fixes issue with displaying date of birth on registration page in a case if there was some validation error triggered in backend. The main problem why it displays incorrectly is applying ONLY output filter to "DoB" value when the form input field are displayed. However when the form submitted correctly Magento applies both Input and Output filter.

\Magento\Customer\Block\Widget\Dob used in 2 templates: Magento/Customer/view/frontend/templates/form/register.phtml
Magento/Customer/view/frontend/templates/form/edit.phtml

Fixed Issues

  1. Date of Birth attribute gets weird format on page reload #7778: Date of Birth attribute gets weird format on page reload
  2. Date of Birth field in customer registration form gets obfuscated on registration failure #11721: duplicate of Date of Birth attribute gets weird format on page reload #7778

Manual testing scenarios

  1. Go to Account Creation Page
  2. Fill In all required fields including Date of Birth, insert already existed email in form.
  3. Observe the result

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Oct 25, 2017

CLA assistant check
All committers have signed the CLA.

@dmanners
Copy link
Contributor

dmanners commented Nov 1, 2017

@nemesis-back thanks for the PR. Could you please have a look at the following travis failure.

There was 1 failure:
1) Magento\Customer\Test\Unit\Block\Widget\DobTest::testSetDateWithFilter
Magento\Customer\Api\Data\AttributeMetadataInterface::getInputFilter() was not expected to be called more than once.
/home/travis/build/magento/magento2/app/code/Magento/Customer/Block/Widget/Dob.php:110
/home/travis/build/magento/magento2/app/code/Magento/Customer/Block/Widget/Dob.php:144
/home/travis/build/magento/magento2/app/code/Magento/Customer/Block/Widget/Dob.php:98
/home/travis/build/magento/magento2/app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php:243

@magento-engcom-team magento-engcom-team added 2.2.x bugfix duplicate Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Nov 7, 2017
@dmanners dmanners removed their assignment Nov 9, 2017
@okorshenko okorshenko self-assigned this Nov 14, 2017
@okorshenko okorshenko added this to the November 2017 milestone Nov 14, 2017
@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Nov 20, 2017

PR fixed the problem but, when we log in to the Customer account that we created and going to My Account -> Account Information section, we can see that Date of Birth is broken now. It doesn't show the 1 digit of the year, and the year picker seems not work as well.
image

@okorshenko
Copy link
Contributor

Hi @nemesis-back Could you please review previous comment?

@okorshenko
Copy link
Contributor

Hi @nemesis-back
We are closing this PR due to inactivity. Please reopen the PR once ready

@okorshenko okorshenko closed this Dec 4, 2017
@nemesis-back
Copy link
Author

Hey @okorshenko , sorry for the delay with this issue. Please reopen this pull request(I don't have necessary permissions) and let me know where should I push new changes(currently they are available
here nemesis-back@4c3cf67)

@RomaKis
Copy link
Contributor

RomaKis commented Jan 4, 2018

Hi @nemesis-back. It is impossible to reopen this pull request now. I think you should checrry-pick you changes and create it again from new 2.2-develop branch. Thanks.

@arnoudhgz
Copy link
Contributor

@nemesis-back could you please create a new pull request for this? I would really like this issue to be fixed, but I don't like to take credit for your work by creating a pull request..........

@arnoudhgz
Copy link
Contributor

For people who are looking for the solution, @KaushikChavda solved this already in the 2.2-develop branch. Please see this PR: #15272

You could create a patch if you need this solution earlier than the 2.2.6 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix duplicate Progress: needs update Release Line: 2.2 Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants