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

Set unit price earlier to prevent wrong comparison #1163

Merged

Conversation

umpirsky
Copy link
Contributor

@umpirsky umpirsky commented Mar 5, 2014

No description provided.

@stloyd stloyd added the Bug Fix label Mar 5, 2014
@stloyd stloyd added this to the 1.0.0-BETA1 milestone Mar 5, 2014
@winzou
Copy link
Contributor

winzou commented Mar 5, 2014

What is this supposed to fix?

I see null === $variant in the if, that means $variant can be null, and you're moving $variant->getPrice before it. I'm not confident :p

@umpirsky
Copy link
Contributor Author

umpirsky commented Mar 5, 2014

@winzou Oh, true. Fixed, thanks.

This sets unit price before calling $cartItem->equals($item), which will return false if price not set since it compares item prices.

@stloyd
Copy link
Contributor

stloyd commented Mar 5, 2014

@umpirsky Would be awesome to see extended spec for this file to prevent regressions =)

@umpirsky
Copy link
Contributor Author

umpirsky commented Mar 5, 2014

@stloyd Yes, but lack of time :(

pjedrzejewski pushed a commit that referenced this pull request Mar 5, 2014
Set unit price earlier to prevent wrong comparison
@pjedrzejewski pjedrzejewski merged commit 3f83bcf into Sylius:master Mar 5, 2014
@pjedrzejewski
Copy link
Member

Thanks Sasha!

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.

None yet

4 participants