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

[Bug Fix] Added customer validator initializer to set canonical email #4747

Conversation

koemeet
Copy link
Contributor

@koemeet koemeet commented Apr 11, 2016

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets fixes #4733
License MIT

Added customer validator initializer that sets email canonical on initialisation. Customer object is now also validating against emailCanonical and uses email as it's error path.

@@ -208,6 +209,11 @@
<argument type="service" id="sylius.repository.customer" />
<tag name="validator.constraint_validator" alias="registered_user_validator" />
</service>

<service id="sylius.user.validator.customer_initializer" class="Sylius\Bundle\UserBundle\Validator\Initializer\CustomerInitializer">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use the class parameter set above :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha, wow, that is stupid..

@pjedrzejewski
Copy link
Member

Great, could you please squash it to a single commit? Thank you Steffen!

@stloyd
Copy link
Contributor

stloyd commented Apr 12, 2016

@pjedrzejewski
Copy link
Member

@stloyd For some reason it does not work, I get that Travis check is required and we should not disable that.

{
$customer->getEmail()->willReturn('sTeFfEn@gMaiL.CoM');
$canonicalizer->canonicalize('sTeFfEn@gMaiL.CoM')
->shouldBeCalled()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldBeCalled should be removed, willReturn is enough.

@koemeet
Copy link
Contributor Author

koemeet commented Apr 12, 2016

You have to click on merge and then you will be able to select if you want to squash it.

@pjedrzejewski
Copy link
Member

@steffenbrem The problem is that I have configured Travis as required check, and this prevents me from squashing it via UI. :/

@koemeet
Copy link
Contributor Author

koemeet commented Apr 12, 2016

That is strange, I have two other projects with the same setup, also a CI check and enabled both merge commit + squash merging. Then I could simply click on Merge pull request and then it lets me choose which merge strategy to use.

G

But np, I will squash it 👍

… email canonical on initialisation. Customer object is now also validating against `emailCanonical` and uses `email` as it's error path.
@koemeet koemeet force-pushed the bugfix/customer-email-validation-canonical-4733 branch from 4484227 to 9c5d944 Compare April 12, 2016 10:58
@pjedrzejewski pjedrzejewski merged commit bede6a3 into Sylius:master Apr 12, 2016
@pjedrzejewski
Copy link
Member

Thanks Steffen!

@koemeet koemeet deleted the bugfix/customer-email-validation-canonical-4733 branch April 12, 2016 18:56
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

Successfully merging this pull request may close these issues.

Customer email canonical validation case insensitivity
5 participants